How can the highlight color used by vim syntastic to mark the errors/warnings in code be changed. The error highlighting is enabled by default and can be changed using
g:syntastic_enable_highlighting
variable.
Asked
Active
Viewed 9,007 times
18

system64
- 909
- 1
- 11
- 27
-
See also: https://stackoverflow.com/q/30501271/1356754 – Brandon Apr 26 '21 at 03:25
2 Answers
25
You can add these lines to your ~/.vimrc
after the last colorscheme
line:
hi SpellBad ctermfg=www ctermbg=xxx guifg=#yyyyyy guibg=#zzzzzz
hi SpellCap ctermfg=www ctermbg=xxx guifg=#yyyyyy guibg=#zzzzzz
with www
/xxx
three digit colors taken from this palette and #yyyyyy
/#zzzzzz
whatever hexadecimal color you want.
You can also edit the relevant lines in your colorscheme.
12
The Syntastic plugin defines two highlight groups:
highlight link SyntasticError SpellBad
highlight link SyntasticWarning SpellCap
You should be able to override this by putting similar lines in your config after Syntastic is loaded using different highlight groups from :highlight
.

Randy Morris
- 39,631
- 8
- 69
- 76
-
1Thanks! I just missed out `SyntasticError` and `SyntasticWarning`. In the doc it only mentions `SyntasticErrorSymbol` and `SyntasticErrorLine` (same for warnings) – system64 Jul 17 '13 at 07:16