+" Swap hex/decimal statusline with \x.
+call Mapping("x", ":call Cycle_HexStatusLine()<CR>:<CR>")
+" Change statusline verbosity with \v.
+call Mapping("v", ":call Cycle_VerboseStatusLine()<CR>:<CR>")
+" Cycle list styles with \l.
+call Mapping("l", ":call Cycle_List()<CR>:<CR>")
+" Toggle tags with \t.
+call Mapping("t", ":Tlist<CR>")
+" Change foldmethod with \f.
+call Mapping("f", ":se foldenable!<CR>:<CR>")
+" Toggle quickfix window with \q.
+call Mapping("q", ":call Cycle_Quickfix()<CR>:<CR>")
+" Rerun filetype detection with \s. The s is for syntax, as this will be
+" updated as a side-effect.
+call Mapping("s", ":filetype detect<CR>:<CR>")
+
+" Change status bar colour when various things happen.
+fun! Highlight_StatusLine(flag)
+ " Get current status.
+ call Iain_Vars()
+
+ " Change the status based on the flag. XXX: Does Vim let us to do flags?
+ let re = "[" . tolower(a:flag) . toupper(a:flag) . "]"
+ let b:iainstatus = substitute(b:iainstatus, re, a:flag, "")
+
+ " Default colour.
+ let s:colour = "darkblue"
+ let s:termcolour = ""
+ let s:term88colour = "17"
+ let s:term256colour = "17"
+ " Maybe override depending on status.
+ if b:iainstatus =~# "H"
+ if b:iainstatus =~# "I"
+ " Held in insert mode. Add extra highlight if we don't have focus.
+ if b:iainstatus =~# "f"
+ let s:colour = "darkmagenta"
+ else
+ let s:colour = "darkred"
+ endif
+ let s:term88colour = "32"
+ let s:term256colour = "88"
+ endif
+ else
+ if b:iainstatus =~# "I"
+ " Regular insert mode.
+ let s:colour = "darkred"
+ let s:term88colour = "32"
+ let s:term256colour = "88"
+ endif
+ endif