let b:iainstatus = substitute(b:iainstatus, re, a:flag, "")
" Default colour.
- let colour = "darkblue"
+ 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 colour = "darkmagenta"
+ let s:colour = "darkmagenta"
else
- let colour = "darkred"
+ let s:colour = "darkred"
endif
+ let s:term88colour = "32"
+ let s:term256colour = "88"
endif
else
if b:iainstatus =~# "I"
" Regular insert mode.
- let colour = "darkred"
+ let s:colour = "darkred"
+ let s:term88colour = "32"
+ let s:term256colour = "88"
endif
endif
- exec "highlight StatusLine guifg=white guibg=" . colour . " ctermbg=white ctermfg=" . colour
+ if &t_Co == 88
+ let s:termcolour = s:term88colour
+ elseif &t_Co == 256
+ let s:termcolour = s:term256colour
+ else
+ let s:termcolour = s:colour
+ endif
+
+ exec "highlight StatusLine guifg=white guibg=" . s:colour . " ctermbg=white ctermfg=" . s:termcolour
endfun
au CursorHoldI * call Highlight_StatusLine("H")
au FocusLost * call Highlight_StatusLine("f")
au InsertEnter * call Highlight_StatusLine("I")
au InsertLeave * call Highlight_StatusLine("i")
+call Highlight_StatusLine("")
" Make diffs vertical by default.
se diffopt+=vertical