aboutsummaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
authorTeddy Wing2014-04-25 22:43:09 -0400
committerTeddy Wing2014-04-25 22:43:09 -0400
commit0f8c89760b75232d82379c22765d208168c8fd74 (patch)
tree4a8b3d129df71ff395026b293a4f40d9062437b1 /vimrc
parent8c39d46cdf7d0e239de8876a6bd8cffb703cd188 (diff)
downloaddotvim-0f8c89760b75232d82379c22765d208168c8fd74.tar.bz2
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.
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc5
1 files changed, 5 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index d45adbe..c7e9142 100644
--- a/vimrc
+++ b/vimrc
@@ -83,6 +83,7 @@
" * Map <leader>/ 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
"
@@ -139,6 +140,10 @@ 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
set statusline+=\ " Separator