vim Normal mode commands (Editing) Repeat the Last Change

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

The Repeat command, executed with the dot or period key (.), is more useful than it first appears. Once learned, you will find yourself using it often.

Command:Description
.Repeat the last change
10.Repeat the last change 10 times

So then, for a very simple example, if you make a change to line 1 by typing iIEsc, with the following result:

1 I made a mistake
2  made a mistake
3  made a mistake

Your cursor will be at position 1 of line 1, and all you need to do to fix the next two lines is press j. twice - that is, j to move down a line and . to repeat the last change, which was the addition of the I. No need to jump back into Insert Mode twice to fix those lines.

It becomes much more powerful when used to repeat macros.



Got any vim Question?