From: Iain Patterson Date: Tue, 21 Aug 2007 10:55:26 +0000 (+0000) Subject: Added option for verbose and less-verbose statusline. X-Git-Url: http://git.iain.cx/?p=profile.git;a=commitdiff_plain;h=06fddc543253f8144360348b13ee49a8a3564082 Added option for verbose and less-verbose statusline. Only show character under cursor and file position in verbose statusline mode. Use Qv to toggle statusline verbosity. git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@64 6be0d1a5-5cfe-0310-89b6-964be062b18b --- diff --git a/.vimrc b/.vimrc index 5b9308d..6bb850d 100755 --- a/.vimrc +++ b/.vimrc @@ -98,6 +98,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 +149,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. @@ -276,6 +284,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 +357,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.