CodeRigor

FREE LESSON

Vim search and repeat: f t ; , / * n

Jump straight to characters and words, and repeat jumps and edits.

Within a line

Key Jumps to
f{c} the next {c}
t{c} just before the next {c}
F{c} / T{c} the same, backwards
; / , repeat the last f/t forward / backward

With operators they're precise: dt; deletes up to the semicolon, ct) rewrites the rest of an argument list.

In the file

Key Does
/text<CR> search forward
?text<CR> search backward
n / N next / previous match
* / # search for the word under the cursor

Putting it together

Search, change, then n and . to apply the same change at the next match — a precise, reviewable alternative to search-and-replace.

Search selects a match; dot repeats your edit
start / 4
n repeats the search, while dot repeats the last change. You decide which matches to edit.
Search selects a match; dot repeats your edit
n repeats the search, while dot repeats the last change. You decide which matches to edit.

Watch & read

Free lectures, talks and readings that cover this skill from another angle. All resources →