VIM, incremental search: how can I go to the next result and highlight it?

When using the VIM incremental search option, I usually do a search, and after I get to the first result (it will be highlighted), I use the / key to move to the next result.

But:

  • To do this, I need to β€œcancel” my search and return to normal mode in order to proceed to the next result.
  • Pressing / VIM advances to the next result, but does not highlight it.

I am wondering if there is a more efficient way to navigate between the results using incremental search and highlight them.

+43
vim search hotkeys
Nov 08 2018-11-11T00:
source share
2 answers

The usual key to advance to the next search result is "n".

I do not quite understand what you mean - all search results should be highlighted if hlsearch is installed, and it does not matter to me if I go to the next result with "n" or with "/".

+68
Nov 08 '11 at 10:12
source share

If you want to highlight all search queries, you must install hlsearch not incsearch .

+6
Nov 08 '11 at 10:18
source share



All Articles