Vim: How to change the highlight color for search hits and quickfix selection

Juve picture Juve · Aug 18, 2011 · Viewed 94.3k times · Source

I am using the desert colorscheme, which uses white text on orange background for highlighting search hits. The same pattern is used for the selected entry in the quickfix window.

White on orange is not very readable. How do I change that in .vimrc?

Edit: Thanks for the fast reply, for the desert scheme I am now using the following search highlight modification:

highlight Search guibg='Purple' guifg='NONE'

Purple is quite easy to detect visually and it is IMHO not used for syntax coloring in the desert scheme.

Answer

Ferdinand Beyer picture Ferdinand Beyer · Aug 18, 2011

Look at $VIMRUNTIME/colors/desert.vim. Color mappings are defined there with the hi[ghlight] command. The search highlighting is defined as

hi Search guibg=peru guifg=wheat

for the GUI and

hi Search cterm=NONE ctermfg=grey ctermbg=blue

for terminals.

You can override this setting in your .vimrc using the same command after you select your colorscheme. Type :h hi for help.