VIM, incremental search: How can I jump to the next result and get it highlighted?

zoltanctoth picture zoltanctoth · Nov 8, 2011 · Viewed 41.4k times · Source

When using VIM's incremental search option I usually search and after I got to the first result (it will be highlighted) I use the / key to jump to the next result.

But:

  1. For this I need to 'cancel' my search and go back to Normal Mode in order to jump the next result.
  2. Pressing / makes VIM jump to the next result but it won't highlight it.

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

Answer

Matthew Walton picture Matthew Walton · Nov 8, 2011

The customary key for jumping to the next search result is 'n'.

I'm not entirely sure what you mean about highlighting - all search results should be highlighted if hlsearch is set, and for me it makes no difference if I go to the next result with 'n' or with '/'.