X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.vimrc;h=3a2f7542b490f9c3fe7ac10925712b5d56d1720f;hb=99881ad89700e483371cc2794d63afab85469498;hp=5b9308d11f757fc330f4632368550fc545a8e01d;hpb=b06e3bd3f984e445593d218b659d9597bdaddcaa;p=profile.git diff --git a/.vimrc b/.vimrc old mode 100755 new mode 100644 index 5b9308d..3a2f754 --- a/.vimrc +++ b/.vimrc @@ -39,6 +39,7 @@ se laststatus=2 " Use C indent style. se cindent se cinkeys=0{,0},0),:,!^F,o,O,e +se cinoptions=b1,c2 " GUI options. se go=aglmr @@ -67,6 +68,10 @@ map = yyp:s/./=/g:let @/='': if version >= "500" version 5.0 +" Save sessions in UNIX format with / as file separator. This is +" cross-platoform. +se ssop+=unix,slash + " Nuke any pre-existing autocommands. autocmd! @@ -98,6 +103,9 @@ fun! Iain_Vars() if ! exists("b:iainhex") let b:iainhex = 0 endif + if ! exists("b:iainverbose") + let b:iainverbose = 0 + endif endfun " Helper for status line. @@ -146,12 +154,17 @@ endfun fun! Show_StatusLine() call Iain_Vars() let sl1='%2n\:\ %<%f\ [%{Show_List()}%{Show_Case()}%{Show_Tabstop()}%{Show_Paste()}%Y%M%R]\ %=' - let sl2='\ \|\ P:%4.6o\ L:%4.6l/%-4.6L\ C:%3.6c\ \|\ %P' + let sl3='L:%4.6l/%-4.6L\ C:%3.6c\ \|\ %P' let hexformat='%b' if b:iainhex let hexformat='0\x%02B' endif - exec "set statusline=" . sl1 . hexformat . sl2 + if b:iainverbose + let sl2=hexformat . '\ \|\ P:%4.6o\ ' + else + let sl2='' + endif + exec "set statusline=" . sl1 . sl2 . sl3 endfun " Restore window size. @@ -228,13 +241,16 @@ syn enable " Nice GUI colour. if has("gui_running") - se guifont=Bitstream\ Vera\ Sans\ Mono\ 12 + se guifont=Bitstream\ Vera\ Sans\ Mono\ 10 colo darkblue endif if has("win32") se guifont=Bitstream_Vera_Sans_Mono:h10:cANSI endif +" Ignore whitespace when diffing. +se diffopt=filler,iwhite + " Expand window when doing a vertical diff. if &diff let &columns = 164 @@ -276,6 +292,13 @@ fun! Cycle_HexStatusLine() call Show_StatusLine() endfun +" Cycle verbose display of toolbar stuff. +fun! Cycle_VerboseStatusLine() + call Iain_Vars() + let b:iainverbose = ! b:iainverbose + call Show_StatusLine() +endfun + " Cycle between number mode. " FIXME: Toggling in a split window doesn't work properly. We need to track " the number of windows and number modes. Something for later... @@ -342,6 +365,8 @@ map Qf :se foldenable!: map Qp :se paste!: " Swap hex/decimal statusline with Qx map Qx :call Cycle_HexStatusLine(): +" Change statusline verbosity with Qv +map Qv :call Cycle_VerboseStatusLine(): " Swap case-sensitivity with Qc. map Qc :call Invert_Case(): " Cycle list styles with Ql. @@ -350,6 +375,8 @@ map Ql :call Cycle_List(): map Qn :call Cycle_Number(): " Toggle tags with Qt. map Qt :Tlist +" Clear search pattern with Q/. +map Q/ :let @/="": " Leaving Perl mode. fun! PerlMode_unmap() @@ -365,6 +392,9 @@ endif if version >= "700" version 7.0 +" Make diffs vertical by default. +se diffopt+=vertical + " Set size of numbers column. se numberwidth=5