From d0c9108a26441d29cc67536f3238b45e411221da Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 9 Nov 2006 16:17:16 +0000 Subject: [PATCH] Use exec for efficiency. Added Q6 (16-space tabs) and Q3 (32-space tabs) binds. git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@34 6be0d1a5-5cfe-0310-89b6-964be062b18b --- .vimrc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.vimrc b/.vimrc index 9e94ae1..0d66b01 100755 --- a/.vimrc +++ b/.vimrc @@ -33,16 +33,17 @@ fun! Iain_Vars() endfun 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 @@ -65,11 +66,13 @@ endfun fun! Cycle_StatusLine() call Iain_Vars() let b:iainhex = ! b:iainhex + let sl1='%2n\:\ %<%f\ [%{Show_List()}%{Show_Case()}%{Show_Tabstop()}%{Show_Paste()}%Y%M%R]\ %=' + let sl2='\ (%3.6c,%-4.6l)\ %4.6o\ \|\ %4.6L\ %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 @@ -121,6 +124,10 @@ 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: " Vim 7 has tabs. Default "next tab" mapping is gt. Add "previous tab" as gb. map gb :tabPrev -- 2.20.1