When I perform a search for something in vim, if it's not found, the "Pattern not found" message is a light/white color on a light blue background, which is very difficult to read.
How can I change the "Pattern not found" colors? I'm happy with the rest of the color scheme, I just want to change the colors of this (and potentially other) such notifications.
:help colorscheme-override
explains how to override parts of a colorscheme.ErrorMsg
, which can be found under :help highlight-groups
, where each group name is highlighted according to your current colorscheme.Therefore, assuming your colorscheme is called foobar
:
augroup my_colorscheme_overrides
autocmd!
autocmd Colorscheme foobar highlight ErrorMsg ctermbg=red
augroup END
If you want your override to work for every colorscheme, just use a *
for the autocommand pattern:
augroup my_colorscheme_overrides
autocmd!
autocmd Colorscheme * highlight ErrorMsg ctermbg=red
augroup END
See :help autocommands
.
Note that this should come before any colorscheme foobar
in your vimrc
.