Vim Recall繁體中文

Paste register 0 after deleting

"0p

Example

Normal mode. Yanked blue with yiw, then deleted other text. Cursor on the space after red.

Before
red 
Cursor on line 1, column 4
  1. "0p Paste register 0 · red blue
After
red blue
Cursor on line 1, column 8
Details & Vim help

Paste from register 0 after deleting.

Paste your copied text even after another deletion changed the unnamed register.

Register 0 is refreshed by a yank without an explicit register. Linewise yanks put whole lines; p places characterwise text after the cursor.

Assumes register 0 contains the characterwise text “blue” and the cursor is on the space after red.

Try it in Vim

  1. Yank a word, such as blue, using yiw.
  2. Delete other text normally.
  3. Move to the insertion point and type "0p.