-fun Cycle_List()
- 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:>
- set list
- else
- set lcs=tab:\\_,trail:_,extends:<,precedes:>,eol:$
- set list
+" Use - and = to create underlines.
+map - yyp:s/./-/g<RETURN>:let @/=''<RETURN>:<RETURN>
+map = yyp:s/./=/g<RETURN>:let @/=''<RETURN>:<RETURN>
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Handle options only available in Vim 5 and above.
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+if version >= "500"
+version 5.0
+
+" Vim 5 hardcodes the size of numbers column to 8.
+let numberwidth=8
+
+" Save sessions in UNIX format with / as file separator. This is
+" cross-platoform.
+se ssop+=unix,slash
+
+" Nuke any pre-existing autocommands.
+autocmd!
+
+" Save the current window width so we can restore it when we quit.
+let oldcols=&columns
+
+" More GUI options. Add icon, tearoffs and toolbar.
+se go+=itT
+
+" Allow dynamic window resize even if we aren't in an xterm.
+se t_WS=\e[8;%p1%d;%p2%dt
+
+" Highlight search results.
+se hlsearch
+
+" Syntax highlighting.
+syn on
+
+" Use a discernably different colour to highlight the cursor which shows
+" matching brackets. Our regular cursor is green so use blue instead of cyan.
+hi MatchParen ctermbg=blue
+
+" Catch typos.
+command! W :w
+command! Wq :wq
+command! Wqa :wqa
+
+" Set up our variables.
+fun! Iain_Vars()
+ if ! exists("b:iainlist")
+ let b:iainlist = 0
+ endif
+ if ! exists("b:iainhex")
+ let b:iainhex = 0
+ endif
+ if ! exists("b:iainverbose")
+ let b:iainverbose = 0
+ endif
+ if ! exists("b:iainstatus")
+ " Window Flags: (F)ocused, (I)nsert mode, Cursor (H)old.
+ let b:iainstatus = "Fih"