From: Iain Patterson Date: Thu, 30 Jan 2014 10:38:08 +0000 (+0000) Subject: Separate statusline colour for replace mode. X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=2355c937f216651eee5a13a4c9c9d3cf37997ac1;p=profile.git Separate statusline colour for replace mode. Use v:insertmode, if available, to highlight the statusline with a slightly different colour when replacing as opposed to inserting. --- diff --git a/.vimrc b/.vimrc index 7f1a8f7..fe6ad8e 100644 --- a/.vimrc +++ b/.vimrc @@ -545,9 +545,16 @@ fun! Highlight_StatusLine(flag) "{{{2 let l:normalcolour = "darkblue" let l:editingcolour = "darkmagenta" + let l:replacecolour = "purple" let l:warningcolour = "darkred" let l:readonlycolour = "red" + if b:iainstatus =~# "I" + if v:insertmode == "r" + let l:editingcolour = l:replacecolour + endif + endif + " Default colour. let l:colour = l:normalcolour " Maybe override depending on status. @@ -586,6 +593,8 @@ fun! Iain_Colour(colour) "{{{2 return 17 elseif a:colour == "darkmagenta" return 33 + elseif a:colour == "purple" + return 35 elseif a:colour == "darkred" return 32 elseif a:colour == "red" @@ -596,12 +605,18 @@ fun! Iain_Colour(colour) "{{{2 return 17 elseif a:colour == "darkmagenta" return 90 + elseif a:colour == "purple" + return 57 elseif a:colour == "darkred" return 88 elseif a:colour == "red" return 196 endif else + " Colours which cterm*g doesn't recognise. + if a:colour == "purple" + return "magenta" + endif return a:colour endif endfun "}}}2 @@ -1238,6 +1253,7 @@ if has("autocmd") au StatusLine FocusGained * call Highlight_StatusLine("F") au StatusLine FocusLost * call Highlight_StatusLine("f") au StatusLine InsertEnter * call Highlight_StatusLine("I") + au StatusLine InsertChange * call Highlight_StatusLine("I") au StatusLine InsertLeave * call Highlight_StatusLine("i") if has("signs")