It is way too easy to repeat the last change you made:

  • . the Normal mode dot command repeats the last change
    • you can also use a number prefix to override the count of the last change

For example,

  • if the last change was 2dd (delete current line and the line below), dot key will repeat 2dd
    • using 3. will mean 3dd and not 6dd, since the count prefix replaces the earlier number
  • if the last change was 5x (delete current character and four characters to the right), dot key will repeat 5x
  • if the last change was C123<Esc> and dot key is pressed, it will clear from the current character to the end of the line, insert 123 and go back to Normal mode

From :h 4.3:

The . command works for all changes you make, except for u (undo), CTRL-R (redo) and commands that start with a colon (:).

info See :h repeat.txt for complex repeats, using Vim scripts, etc.

Video demo:


info See also my Vim Reference Guide and curated list of resources for Vim.