Vim Recall繁體中文

Replay the last colon command

@:

Example

Normal mode on line 1. Both lines contain old. Run no other colon commands between these steps.

Before
old
old
Cursor on line 1, column 1
  1. :s/old/new/<CR> Line 1 becomes new; substitution remembered
  2. j Line 2 · still old
  3. @: Repeat substitution · both lines now say new
After
new
new
Details & Vim help

Execute the most recent command-line command again.

Repeat Ex operations that dot does not replay.

Any later typed Ex command can replace what @: replays, including inspection commands. Requires command-line history support. Dot repeats Normal-mode changes, not arbitrary Ex commands.

Run :s/old/new/ on line 1, move to line 2, then use @: without typing another colon command.

Try it in Vim

  1. Run :s/old/new/ on one line.
  2. Move to another line containing old.
  3. Type @: to run the substitution there.