I've switched from the basic theme in terminal to a customized one. The colour issue I'm having with incompatible colours is with hlsearch. Is there a way to change the colour of the highlighted search?

I've tried searching for a solution but my search mostly brings up how to turn highlighting off after search. I would also accept a solution that underlines searches or only highlighted the first char of the search.


The highlight group you are looking for is Search. You can see the current values with

:hi Search

You can clear the current values with either of

:hi clear Search
:hi Search NONE

How you set new values depends on the effect you want. Take a look at

:help 06.3
:help :highlight

To use just underlining for searches, execute

:hi Search term=underline cterm=underline gui=underline

Or you can change the foreground and/or background colors to suit your taste using the :highlight arguments and attributes described in :help :highlight. Those :highlight commands can go in your custom colorscheme file.

I don't know of a way to highlight just the first character of a search, but you can turn off search highlighting with

:set nohls

and just use the cursor to indicate where a match was found. See

:help hls
  • Thank you. I was doing :h hlsearch And had not found :h highlight – Ravenous Aug 1 '14 at 17:44

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.