VIM, incremental search: How can I jump to the next result and get it highlighted?
SearchVimHotkeysSearch Problem Overview
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:
- For this I need to 'cancel' my search and go back to Normal Mode in order to jump the next result.
- 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.
Search Solutions
Solution 1 - Search
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 '/
Solution 2 - Search
With Ctrl-t
and Ctrl-g
you can move between matches without leaving the search mode
Solution 3 - Search
If you want to highlight all search hits you should set hlsearch
not incsearch
.