.
The
Command
The . command in Vim
Command
repeat last
Repeat the last change. One of the most powerful keys in Vim — combine with motions and
n to apply changes across a file efficiently.Examples
cwiNEW<Esc> then . (change next word)dd then . (delete next line)A;<Esc> then j. (add ; to each line)n.(repeat change on next match)
Related plugin
tpope/vim-repeat — Makes . work correctly with plugin commands (vim-surround, vim-commentary, etc.) instead of only built-in changes.
Reference
Learn every Vim command visually — right in your browser.
Add Vim What? to Chrome — FreeAlso on Firefox.
Related commands