endif
:autocmd!
-" Initialise list format per buffer.
-au BufEnter * let b:iainlist = 0 | let b:iainhex = 1 | call Cycle_StatusLine()
+" 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
+endfun
fun Cycle_List()
+ call Iain_Vars()
let b:iainlist += 1
if b:iainlist > 2 | let b:iainlist = 0 | endif
if b:iainlist == 0
endfun
fun Show_List()
+ call Iain_Vars()
if b:iainlist == 0
" No list.
return " "
" Cycle between hex and decimal display of toolbar stuff
fun Cycle_StatusLine()
+ call Iain_Vars()
let b:iainhex = ! b:iainhex
if b:iainhex
set statusline=%2n\:\ %<%f\ [%{Show_List()}][%{Show_Case()}]%y%m%r%=0\x%02B\ (%3.6c,%-4.6l)\ 0\x%04.6O\ \|\ %4.6L\ %P
" Cycle list styles with ,l.
map ,l :call Cycle_List()<CR>:<CR>
+call Cycle_StatusLine()
+
au VimLeave * if exists("andyoldcols") | let &columns=andyoldcols | endif
" Autocommands to setup features we only want in certain modes...