From 3fffbc8f6946ccd546512b3f6aa43ff3f099f68f Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 8 Aug 2008 13:46:15 +0000 Subject: [PATCH] Try to match up darkblue and darkred colours for the status bar in terminals. git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@124 6be0d1a5-5cfe-0310-89b6-964be062b18b --- .vimrc | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.vimrc b/.vimrc index ad273c6..05646ee 100644 --- a/.vimrc +++ b/.vimrc @@ -366,25 +366,40 @@ fun! Highlight_StatusLine(flag) 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") @@ -393,6 +408,7 @@ au FocusGained * call Highlight_StatusLine("F") 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 -- 2.20.1