I have a problem with search highlighting in vim. I have used it before but currently it does not work at all.
:set hlsearch
, which is also in my .vimrc file.:set hlsearch?
and the result is hlsearch
, indicating that I have successfully turned the option on. (right?)I would appreciate any input as this has been driving me nuts. Thanks!
Edit: highlighting also doesn't work for spellcheck, so evidently it's something global about highlighting.
Add set hlsearch in the file. Save the file. Now your search will always be highlighted in vim. For single time use, just use :set hlsearch in vim, which will be in effect for that instance only. how to remove that highlight once i have found out the matches? i pressed escape and the highlight still exists.
To highlight all search matches, set the following option: With the defaults, setting this option causes all text matching the current search to be highlighted using the Search highlight group, which adds a yellow background to the current highlighting. See :help hl-Search, or type :hi Search to see what color you have it set to.
For those who are looking to remove the highlight (s), according to :help hlsearch, just type :nohlsearch. Your next search will still get highlighted.
See :help hl-Search, or type :hi Search to see what color you have it set to. You can easily change the default highlighting with, for example, :hi Search guibg=LightBlue . To disable the highlighting temporarily, enter (this is a command, not an option):
When you have problems with multiple highlightings (like search and spell in your case), first check the defined highlightings with
:hi
If any groups are wrong or off, check your :colorscheme
, and maybe try another.
In the console, color problems are often related to the number of available colors, a hairy problem. Check with
:set t_Co?
Another good tool for checking problems with individual syntax items is the SyntaxAttr.vim - Show syntax highlighting attributes of character under cursor plugin.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With