1

When I do a search within VIM the found text is highlighted in yellow with white letters. For my eyes it is impossible to distinguish the text highlighted. I am looking for the way to change those highlight colors.

Edit:

My comment to wbogacz did not format well and I do not see a reply option, so I edit here again.

I am a Linux and vim notice. When you wrote:

:edit $VIMRUNTIME/colors/colors_name.vim

That begins with the colon so I presume it is from within vim. I was not able to get that to work. Opening another terminal and using the command line for

Echo $VIMRUNTIME

Yields a blank line. Looking at your line

hi Search term=reverse ctermfg=Black ctermbg=Cyan gui=NONE guifg=Black guibg=Cyan

That will take some learning on my part. Where does it belong? Where can I read about that?

2
  • The search for this site (non-mobile version at least) is at the very top of the window where it says Search on Vi and Vim. If you don't see that you should make sure you don't have any browser extensions or the like modifying what you see. Note: this question is likely to be closed as "duplicate" or "unclear" or some other reason.
    – B Layer
    Commented Apr 13, 2018 at 0:42
  • You need to substitute the name of your actualy colorscheme in the command: :edit $VIMRUNTIME/colors/colors_name.vim. See the paragraphs just before and after that command in @wbogacz's answer. $VIMRUNTIME isn't usually set outside of Vim. See :help $VIMRUNTIME. The documentation for :hi is at :help :hi, but you should probably start off by reading :help usr_06.txt.
    – Rich
    Commented Apr 13, 2018 at 9:53

1 Answer 1

1

I am unclear the intent of your question.

Searching and those results within VIM?

In which case follow this general procedure:

Find the colorscheme you are in:

:echo g:colors_name

Mine is wolf.

Find the file for edit at (generally):

:edit $VIMRUNTIME/colors/colors_name.vim

So, mine is

:edit $VIMRUNTIME/colors/wolf.vim

find the line for Search; mine is:

hi Search term=reverse ctermfg=Black ctermbg=Cyan gui=NONE guifg=Black guibg=Cyan

which shows searched terms in Black on Cyan. There are a variety of additional colors for term, in case it is necessary.

For further info on highlight in vim see:

:he highlight

OR are you searching and want those results (former questions) within Stackexchange (the question is unclear)?

Use the Search bar with general terms right next to the Stackexchange icon at top of screen.

Terms such as 'highlight colors' will search this Stackexchange to provide previous relevant questions and their answers.

2
  • I am a Linux and vim notice. When you wrote: :edit $VIMRUNTIME/colors/colors_name.vim That begins with the colon so I presume it is from within vim. I was not able to get that to work. Opening another terminal and using the command line for Echo $VIMRUNTIME Yields a blank line. Looking at your line hi Search term=reverse ctermfg=Black ctermbg=Cyan gui=NONE guifg=Black guibg=Cyan That will take some learning on my part. Where does it belong? Where can I read about that?
    – bkelly
    Commented Apr 12, 2018 at 21:16
  • From within vim, :he highlight takes you to the relvant help section. It will inform you about the different highlight classes, the relevant syntax for the colors, etc. That same section informs you of the ways to find your colors folder, and the specific active color file to edit.
    – wbogacz
    Commented Apr 13, 2018 at 1:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.