Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Disable (Or Toggle) Text Search Result Highlights In Vim and Neovim

## Turning Highlights Off

Neovim/Vim highlights all the matching results when you do a text search in a file buffer. You can hide the highlights after the search with [TODO: Code shorthand span ] but that's a pain to do every time. To disable them full time, add this to your [TODO: Code shorthand span ] or [TODO: Code shorthand span ] config file :

set nohlsearch

## Toggling Highlights

Another option is to toggle the highlights on and off. Instead of using ` set nohlsearch ` , this can be done by adding the following to your config file :

set hlsearch!
nnoremap <F5> :set hlsearch!<CR>

With that in place, hitting [TODO: Code shorthand span ] will switch showing highlights on and off.

## One File Only

You can also run those commands directly in a single file buffer (prepended by a ` : ` ) to apply to just that buffer. That is :

:set nohlsearch

and

set hlsearch!
nnoremap <F5> :set hlsearch!<CR>