Vim's colors look good and everything seems to work fine, but at start up I consistantly get this error:

Error detected while processing function <SNR>20_colorscheme..<SNR>20_highlight_do:
line    1:
E421: Color name or number not recognized: ctermfg=SeaGreen ctermbg=none
E421: Color name or number not recognized: ctermbg=Grey40
E421: Color name or number not recognized: ctermbg=Grey40
Press ENTER or type command to continue

This makes the boot up time for vim really long and I can't seem to fix it. silent! when setting the colorscheme doesn't work.

Furthermore grepping to try and see where the error comes from doesn't help either

 % grep -r "ctermbg=Grey40" ~/.vim/

Any advice on where to start?

  • I'd suggest checking the files in /usr/share/vim or /etc/vim . . .
    – ernie
    Apr 10 '14 at 18:10
  • Which OS are you using? How is Vim installed on your system (i.e. did you do it manually or use a package/installer)?
    – Heptite
    Apr 10 '14 at 18:32
  • 2
    Actually, it looks like you have a badly designed colorscheme file. For the cterm* color options I don't think Vim allows you to use color names like you can for the gui* color options. Which colorscheme are you using? Where did you obtain it?
    – Heptite
    Apr 10 '14 at 20:38
  • zenburn, can't remember where I got it. Apr 10 '14 at 21:35
  • 1
    Patch 7.4.2182 addresses this issue: Problem: Color Grey40 used in startup but not in the short list. Solution: Add Grey40 to the builtin colors.
    – Heptite
    Sep 29 '18 at 17:24

Look at the output of :scriptnames. Whichever script is listed as #20 is the culprit, since the functions <SNR>20_colorscheme and <SNR>20_highlight_do are local to that script. Or you could try grepping for "highlight_do".

  • 20: ~/.vim/plugin/colorsupport.vim removing this fixed it. Thanks! Apr 10 '14 at 21:37

Some colorschemes require 256-color terminal. In my case the following command helped (before running vim):

export TERM='xterm-256color'

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.