X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.vimrc;h=4607a5eef476125d6f9dbb8ddf6c56a98198912e;hp=302efbba56514983be15bd156c46b833b7a4c65d;hb=56d7364df9209bffe2ca58df0474e2555b75cb45;hpb=56dea345d192b18440e1fd7846458ec824fced16;ds=inline diff --git a/.vimrc b/.vimrc index 302efbb..4607a5e 100644 --- a/.vimrc +++ b/.vimrc @@ -669,27 +669,45 @@ endfun "}}}2 " Helper for status line. " Show file encoding -func! Show_Encoding() "{{{2 +fun! Show_Encoding() "{{{2 + if version < "600" + return "" + endif + let l:enc = &fenc + let l:symbol = "" if l:enc == "" let l:enc = &enc if l:enc == "" return "" endif - let l:enc = '(' . l:enc . ')' + if bufname("%") == "" + if Has_Unicode() + let l:symbol = '•' + else + let l:symbol = '*' + endif + endif endif if has("multi_byte") if &bomb if Has_Unicode() - let l:enc = l:enc . "☻" + let l:symbol = "☻" else - let l:enc = l:enc . "@" + let l:symbol = "@" endif endif endif - return l:enc . "," + " Don't return anything if the encoding is utf-8. + if l:enc == "utf-8" + if l:symbol == "" + return "" + endif + endif + + return l:symbol . l:enc . "," endfun "}}}2 " Helper for status line.