X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.vimrc;h=bc459b3b6566b1b8eb6e3bd6e499c1a931bb4a0b;hp=31012c7fe5ea2851b23649299b2950bc6a512aff;hb=5dc7815f5686ea5032214933fcd6740e875ce1af;hpb=6aa821a9fbf33646c1f3f77e9f97f64d7f36f31c diff --git a/.vimrc b/.vimrc index 31012c7..bc459b3 100644 --- a/.vimrc +++ b/.vimrc @@ -1,5 +1,5 @@ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Multi-version vimrc compatible with version 4 and above. vim:set fdm=marker: +" Multi-version vimrc compatible with version 4 and above. vim6:set fdm=marker: """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Note that "if | call Something() | endif" syntax is unsupported @@ -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. @@ -876,8 +894,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_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' @@ -1214,13 +1241,13 @@ if has("autocmd") " Show signs by default. au Display VimEnter * call Cycle_Signs(0) endif -endif "}}}1 " move. nmap MoveLineHalfPageUp nmap MoveLineHalfPageDown vmap MoveBlockHalfPageUp vmap MoveBlockHalfPageDown +endif "}}}1 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Handle options only available in Vim 7 and above. @@ -1395,7 +1422,6 @@ let g:bufExplorerSplitOutPathName=0 " NERDcommenter. let g:NERDSpaceDelims=1 -endif "}}}1 " localvimrc. let g:localvimrc_persistent=1 @@ -1403,6 +1429,7 @@ let g:localvimrc_persistent=1 " Gitv. let g:Gitv_OpenHorizontal='auto' let g:Gitv_WipeAllOnClose=1 +endif "}}}1 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Handle options only available in Vim 7.2 and above.