2

How can I remove the horrible color of my vim status bar has? I'd like it to be the same color as the background.

enter image description here

My current settings in my ~./.vimrc file (or ~/.vimrc.after file as I use) which relate to the status bar are:

set laststatus=2                            " Show the last status
hi statusline guibg=#263238

set statusline=%f                           " Filename

function! InsertStatuslineColor(mode)
  if a:mode == 'i'
    hi statusline guibg=#573E81 guifg=#263238
  elseif a:mode == 'r'
    hi statusline guibg=blue guifg=#263238
  else
    hi statusline guibg=red guifg=#263238
  endif
endfunction

au InsertEnter * call InsertStatuslineColor(v:insertmode)
au InsertChange * call InsertStatuslineColor(v:insertmode)
au InsertLeave * hi statusline guibg=#c5c8c6 guifg=#263238

" default the statusline to green when entering Vim
hi statusline guibg=#c5c8c6 guifg=#263238

I am using MacVim v7.4 (88).

1
  • does setting the statuslinecolor not work? Commented Jan 12, 2016 at 17:02

2 Answers 2

3

There are several places in the code where you specifically set the statusline background to a sort of grayish colour with commands like:

hi statusline guibg=#c5c8c6 ...

You need to replace these with lines like:

hi statusline guibg=NONE ...

...to remove the colour.

If your statusline background still isn't correct you might have also have reverse set. Check if the output of :hilight statusline contains gui=reverse.

If so, you will also need to clear this setting, like so:

hi statusline guibg=NONE gui=NONE ...

See :help :highlight for further details.

0

In vim, typing


highlight clear StatusLine

worked for me

1
  • 1
    Welcome to Vi and Vim! Note that this will clear all colors from normal status line text
    – D. Ben Knoble
    Commented Mar 25, 2021 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.