Vim Recall繁體中文

Reuse your previous inserted text

<C-a> in Insert mode

Example

Insert mode after “note: ”, including its trailing space. Previous completed insertion: ready only.

Before
note: 
  1. <C-a> note: ready · stays in Insert mode
After
note: ready
Details & Vim help

Insert the text from the previous insertion again.

Repeat a short phrase at a new insertion point.

Insert-mode Ctrl-a differs from Normal-mode Ctrl-a, which increments numbers. The stored insertion can contain editing actions; keep the previous insert simple when you want predictable text reuse.

Assumes the previous insertion was “ready” and the current Insert-mode cursor is at the line end.

Try it in Vim

  1. Insert a phrase and leave Insert mode with <Esc>.
  2. Start a new insertion at the destination.
  3. Press Ctrl-a to insert the previous inserted text and remain in Insert mode.