X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.vimrc;h=eac19ca2c928c9722373714641e6400eff69dcb6;hb=789130b8f3550e4b08dcbcf8ca20f63d6b254e90;hp=9e94ae1024a033b6a072d45cd2112d132ed67d93;hpb=e6b7d067305c80c6177a29ce106ac847d2e641cb;p=profile.git diff --git a/.vimrc b/.vimrc index 9e94ae1..eac19ca 100755 --- a/.vimrc +++ b/.vimrc @@ -29,20 +29,22 @@ endif " Set up our variables. fun! Iain_Vars() if ! exists("b:iainlist") | let b:iainlist = 0 | endif - if ! exists("b:iainhex") | let b:iainhex = 1 | endif + if ! exists("b:iainhex") | let b:iainhex = 0 | endif endfun +" Change list mode. fun! Cycle_List() + let basic='tab:\\_,trail:_,extends:<,precedes:>' call Iain_Vars() let b:iainlist = b:iainlist + 1 if b:iainlist > 2 | let b:iainlist = 0 | endif if b:iainlist == 0 set nolist elseif b:iainlist == 1 - set lcs=tab:\\_,trail:_,extends:<,precedes:> + exec "set lcs=" . basic set list else - set lcs=tab:\\_,trail:_,extends:<,precedes:>,eol:$ + exec "set lcs=" . basic . ",eol:$" set list endif endfun @@ -62,14 +64,21 @@ fun! Show_List() endfun " Cycle between hex and decimal display of toolbar stuff. -fun! Cycle_StatusLine() +fun! Cycle_HexStatusLine() call Iain_Vars() let b:iainhex = ! b:iainhex + call Show_StatusLine() +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 hexformat='%b' if b:iainhex - set statusline=%2n\:\ %<%f\ [%{Show_List()}%{Show_Case()}%{Show_Tabstop()}%{Show_Paste()}%Y%M%R]\ %=0\x%02B\ (%3.6c,%-4.6l)\ 0\x%04.6O\ \|\ %4.6L\ %P - else - set statusline=%2n\:\ %<%f\ [%{Show_List()}%{Show_Case()}%{Show_Tabstop()}%{Show_Paste()}%Y%M%R]\ %=%b\ (%3.6c,%-4.6l)\ %4.6o\ \|\ %4.6L\ %P + let hexformat='0\x%02B' endif + exec "set statusline=" . sl1 . hexformat . sl2 endfun " Save the current window width so if we change it we can restore it @@ -110,7 +119,7 @@ endfun map Q " Swap hex/decimal statusline with Qx -map Qx :call Cycle_StatusLine(): +map Qx :call Cycle_HexStatusLine(): " Swap case-sensitivity with Qc. map Qc :call Invert_Case(): " Cycle list styles with Ql. @@ -121,11 +130,21 @@ map Q2 :se ts=2: map Q4 :se ts=4: " Change to ts=8 with Q8. map Q8 :se ts=8: +" Change to ts=16 with Q6. +map Q6 :se ts=16: +" Change to ts=32 with Q3. +map Q3 :se ts=32: +" Change foldmethod with Qf. +map Qf :se foldenable!: +" Change number mode with Qn. +map Qn :se number!: +" Toggle paste mode with Qp. +map Qp :se paste!: " Vim 7 has tabs. Default "next tab" mapping is gt. Add "previous tab" as gb. map gb :tabPrev -call Cycle_StatusLine() +call Show_StatusLine() au VimLeave * if exists("andyoldcols") | let &columns=andyoldcols | endif