From 0f8c89760b75232d82379c22765d208168c8fd74 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 25 Apr 2014 22:43:09 -0400 Subject: vimrc: add file encoding to statusline Useful to know. I like having it in BBEdit for those cases when a file is for whatever reason not UTF-8, so adding it in here. --- vimrc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vimrc') diff --git a/vimrc b/vimrc index d45adbe..c7e9142 100644 --- a/vimrc +++ b/vimrc @@ -83,6 +83,7 @@ " * Map / to clear search highlighting " * Map gj -> j and gk -> k so we can still skip wrapped lines if we want " * Set ignorecase and smartcase +" * Add file encoding to statusline " @@ -138,6 +139,10 @@ set laststatus=2 " Always show the status line set statusline=%f " Path to file set statusline+=\ " Separator 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+=\ " Separator set statusline+=%m " File modified? flag set statusline+=%r " Readonly? flag -- cgit v1.2.3