." command repeats the last change made in normal mode. For example, if you press
dw to delete a word, you can then press
. to delete another word (
. is dot, aka period or full stop).
@:" command repeats the last command-line change (a command invoked with "
:", for example
You can move the cursor before using either of the repeat commands.
Suppose you press
dd to delete a line. Next, you might move the cursor, then press
5 then dot). That will delete 5 lines.
In normal mode, press
J to join the next line onto the current line. Press
. to join more lines.
Or, you might use insert mode to type "
hello ". Press Esc for normal mode, then move the cursor, and press
. to insert "hello " again.
- Using command-line history
- Repeat command on each line in visual block
- Recording keys for repeated jobs
- Repeat last colon command
- Repeating an ex command on multiple blocks
- Repeat last command and put cursor at start of change