vim-cheat-sheet
vim-cheat-sheet copied to clipboard
Add `gn` command
Imho gn
is important enough to be added in section "Search and replace".
gn Search forward for the last used search pattern, like
with `n`, and start Visual mode to select the match.
If the cursor is on the match, visually selects it.
If an operator is pending, operates on the match.
E.g., "dgn" deletes the text of the next match.
If Visual mode is active, extends the selection
until the end of the next match.
'wrapscan' applies.
Note: Unlike `n` the search direction does not depend
on the previous search command.
See also: http://vimcasts.org/episodes/operating-on-search-matches-using-gn/