From efe80dae8fcc95865794d32055a997a479ae81d5 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 27 Jun 2014 23:26:53 -0400 Subject: 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. --- vimrc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'vimrc') diff --git a/vimrc b/vimrc index 1de14ac..93ddb0f 100644 --- a/vimrc +++ b/vimrc @@ -222,7 +222,10 @@ " * Update 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 -- cgit v1.2.3