aboutsummaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
authorTeddy Wing2014-06-27 23:26:53 -0400
committerTeddy Wing2014-06-27 23:26:53 -0400
commitefe80dae8fcc95865794d32055a997a479ae81d5 (patch)
tree582366fbf13120d21630f661e6b7166173ad33fe /vimrc
parentb95652a81bc3c8ce534386772569f65692f9cd86 (diff)
downloaddotvim-efe80dae8fcc95865794d32055a997a479ae81d5.tar.bz2
vimrc: add line ending type to statusline
Show the type of line ending (line feed or carriage return & line feed, or in vim land unix & dos) in the statusline.
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc8
1 files changed, 6 insertions, 2 deletions
diff --git a/vimrc b/vimrc
index 1de14ac..93ddb0f 100644
--- a/vimrc
+++ b/vimrc
@@ -222,7 +222,10 @@
" * Update <c-h> save mapping in visual mode to reselect the last
" selected area
"
-"
+" 2014.06.27:
+" * Remove the space after the file encoding in the statusline
+" * Add a statusline item that says what line endings are used in the
+" current file. "LF" is used for unix, "CRLF" is used for dos.
"
@@ -297,7 +300,8 @@ set statusline+=%y " Filetype
set statusline+=\ " Separator
" File encoding
" (http://vim.wikia.com/wiki/Show_fileencoding_and_bomb_in_the_status_line)
-set statusline+=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}
+set statusline+=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\"}
+set statusline+=%{\"[\".(&fileformat==\"unix\"?\"LF\":(&fileformat==\"dos\"?\"CRLF\":\"\")).\"]\ \"}
set statusline+=\ " Separator
set statusline+=%m " File modified? flag
set statusline+=%r " Readonly? flag