Repeat Last Change

. โ€” replay the last change. The single most useful key.

Keys: .

The . command repeats the last change โ€” exactly what you did, including any inserted text. It is what makes Vim feel like Vim.

If Vim has a single most-loved key, this is it. . replays the last change. Not the last keystroke, not the last motion โ€” the last change. That distinction is the whole reason . feels magical.

Repeat last change
KeyNote
.
The dot command

Reference

Key Action
. Repeat last change at cursor
{n}. Repeat last change with new count {n}
".p Paste the actual recorded change as text

Worked example โ€” .

The single most powerful key in Vim.

Step 1 ยท
[missing screenshot dot.repeat/frame_01.color.svg โ€” run python content/render_screenshots.py]
Step 2 ยท cwxxxEsc ยท cw to xxx, Esc.
[missing screenshot dot.repeat/frame_02.color.svg โ€” run python content/render_screenshots.py]
Step 3 ยท j0. ยท . โ€” same change at new cursor.
[missing screenshot dot.repeat/frame_03.color.svg โ€” run python content/render_screenshots.py]

Dot replays the last change (anything that modified the buffer). Cheap revolution: structure your motions so dot becomes useful.

Step 4 ยท j0. ยท . again โ€” third line.
[missing screenshot dot.repeat/frame_04.color.svg โ€” run python content/render_screenshots.py]

Move-and-dot is a Vim idiom. Beats keyboard macros for trivial repetitions.

See also: Dot with Counts, Dot Patterns, Change-Next-Match Loop โ€” cgn, Undo and Redo