Home » Questions » Computers [ Ask a new question ]

Underlining search results in vim (instead of highlighting them)

Underlining search results in vim (instead of highlighting them)

Right now, all of my search results in vim are highlighted in a bright (i.e. unreadable) yellow. I was wondering if there was a way to set the highlighting for search results to underline instead of highlight. I did some searching online and it seems possible, but the vim documentation is so obfuscated that I can't make out the syntax for this.

Asked by: Guest | Views: 283
Total answers/comments: 1
Guest [Entry]

"You need to modify the highlighting for the 'Search' syntax element. You can do that with a command like this:

:highlight Search guibg=black guifg=yellow gui=underline

That command will set the text color (i.e, foreground) of the found search words to yellow (againt black background) and will underline them. The command above alters only the highlighting for the gui, which means in gvim. Altering in terminal, I think would be this:

:highlight Search ctermbg=black ctermfg=yellow term=underline"