Vim: highlight all matches in incsearch

You can use the incsearch.vim plugin:

Automatic :nohlsearch

Install with your favourite plugin manager and map your search key(s) to call the plugin's search.


Unfortunately, this isn't possible without writing your own search in Vimscript (capturing each key via getchar(), highlighting via :match), or patching the core Vim source code in C.

The reason this isn't implemented is probably to keep the incsearch snappy and immediate.

Update: Highlighting all matches now is the default behavior starting with Vim 7.4.2259 (with 'incsearch' can only see the next match).

Tags:

Vim