X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.vimrc;h=c2a88f8e528a44865f21493a6c74012d9ef13dae;hb=dc63ca686dd762680e884a55538135cb197da9b6;hp=302efbba56514983be15bd156c46b833b7a4c65d;hpb=56dea345d192b18440e1fd7846458ec824fced16;p=profile.git diff --git a/.vimrc b/.vimrc index 302efbb..c2a88f8 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. @@ -727,6 +745,15 @@ fun! Show_Case() "{{{2 endfun "}}}2 " Helper for status line. +" Mark DOS buffers. +fun! Show_DOS() "{{{2 + if &ff == "unix" + return "" + endif + return &ff . "," +endfun "}}}2 + +" Helper for status line. " Show the size of the tabstop. fun! Show_Tabstop() "{{{2 return &ts @@ -876,8 +903,17 @@ fun! Show_StatusLine() "{{{2 return endif call Iain_Vars() - let l:sl1='%2n\:\ %<%1*%f%0*\ [%{Show_Encoding()}%{Show_List()}%{Show_Bind()}%{Show_Case()}%{Show_Tabstop()}%{Show_Paste()}%{Show_VirtualEdit()}%{Show_Undo()}%Y%M%R%{Show_SearchForward()}]%{Show_Alt()}\ ' - let l:sl3='%{Show_Marks()}L:%1*%4.6l%0*/%-4.6L\ C:%1*%3.6c%V%0*\ \|\ %P' + + " User{N} highlights %{N}*. + " Named highlight groups %#group% aren't available until Vim 7. + let l:normal = '%0*' + let l:bold = '%1*' + + " sl1 contains left-aligned stuff. + " sl2 contains stuff shown only when verbose mode is enabled. + " sl3 contains right-aligned stuff. + let l:sl1='%2n\:\ %<' . l:bold . '%f' . l:normal . '\ [%{Show_Encoding()}%{Show_DOS()}%{Show_List()}%{Show_Bind()}%{Show_Case()}%{Show_Tabstop()}%{Show_Paste()}%{Show_VirtualEdit()}%{Show_Undo()}%Y%M%R%{Show_SearchForward()}]%{Show_Alt()}\ ' + let l:sl3='%{Show_Marks()}L:' . l:bold . '%4.6l' . l:normal . '/%-4.6L\ C:' . l:bold . '%3.6c%V' . l:normal . '\ \|\ %P' let l:hexformat='%b' if b:iainhex let l:hexformat='0\x%02B' @@ -1228,6 +1264,11 @@ endif "}}}1 if version >= "700" "{{{1 version 7.0 +" Narrow buffer with \w. +call Mapping("w", ":NarrowRegion:") +" Narrow window with \W. +call Mapping("W", ":NarrowWindow:") + " Helper to show tab name. fun! TabName(label, gui) "{{{2 let l:label = a:label