search

n / N

n jumps to the next match of the last search, N to the previous. Direction is relative to the ORIGINAL search direction — if you searched with ?, then n goes backward.

n  N  (normal mode)

Variations

Keystroke Effect
3n Jump forward 3 matches
:noh Clear the search highlight (until next search)
gn Visually select the next match — pairs beautifully with c/d/y

Examples

/foo<Enter>nn

Find foo and jump to the third occurrence

cgn bar<Esc>.

Change next match to bar; . repeats on each next match

N

Jump to previous match

Gotcha

n's direction depends on whether the search started with / or ? — after ?foo, n goes UP the file. Use / to reset direction.

Related

← All Vim commands · Vim cheat sheet