2

I tried:

hi StatusLine ctermfg=red
highlight statisline ctermfg=red
hi! statusline ctermfg=008
hi statusline ctermfg=008
hi statusline cterm=bold
hi StatusLineNC ctermfg=2 ctermbg=8 cterm=NONE
hi StatusLineNC ctermfg=2 ctermbg=8 cterm=NONE

Nothing changes.

macOS, the latest Vim 8 from Brew, in default terminal.

My vimrc.

  • The spelling should be StatusLine and StatusLineNC. Your question has wrong spelling. Maybe that's the problem. – klaus Jun 30 '18 at 1:46
  • I tried StatusLine too. – Vitaly Zdanevich Jun 30 '18 at 10:37
  • If you don't mind me saying so, your vimrc needs serious tending. Please have the decency to at least use augroup enclosing the autocmds. – klaus Jun 30 '18 at 12:37
  • @EnanAjmain yes I was a little ashamed to post my vimrc here, I need to prettify it... – Vitaly Zdanevich Jun 30 '18 at 12:46
  • @EnanAjmain besides augroup - what is your other recommendations for my vimrc? – Vitaly Zdanevich Jun 30 '18 at 14:03
1

Possible solutions, try them all:

  • Check if you're using set termguicolors in your vimrc. If yes, then either disable it or use guibg and guifg instead of ctermbg and ctermfg respectively.

  • Check if you're calling for changing the colorscheme after you set your statusline highlights. You should call your colorscheme before you set personalized statusline highlights.

That should do it.

Edit:

You currently have groupwise highlight set to User{N}, i.e. your vimrc has:

set statusline=%1*%F%h%m%=\ [%p%%]\ [%l/%L]:%c

see the part with %1*? that's what I'm talking about. The solutions are

  • Remove it. Or,
  • Read through the help docs :h statusline and learn to use User{N} highlight properly, specially the part about

    * -   Set highlight group to User{N}, where {N} is taken from the
      minwid field, e.g. %1*.  Restore normal highlight with %* or %0*.
      The difference between User{N} and StatusLine  will be applied
      to StatusLineNC for the statusline of non-current windows.
      The number N must be between 1 and 9.  See |hl-User1..9|
    
  • I tried the last line in my vimrc and entering commands in running Vim, nothing; my vimrc without set termguicolors :( – Vitaly Zdanevich Jun 29 '18 at 18:05
  • That's odd. Could you link your vimrc in the post? – klaus Jun 30 '18 at 1:45
  • Added link to vimrc. – Vitaly Zdanevich Jun 30 '18 at 10:43
  • Got what's wrong. Edited the post. At first paste this at the very bottom of your vimrc, set statusline=%t%m%=%l,%v and check if the error is fixed. After that read the answer above. – klaus Jun 30 '18 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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