vimtricks.wiki Concise Vim tricks, one at a time.

How do I paste back a small deletion (like a deleted character) while in insert mode?

Answer

<C-r>-

Explanation

In insert mode, <C-r>- pastes the contents of the small delete register ("-). Vim stores any deletion that is less than one full line and was not directed to a named register into "-. This makes it easy to recover a recently deleted word, character, or small chunk of text without leaving insert mode or changing your current position.

How it works

  • <C-r> in insert mode — inserts the content of a register
  • - — the small delete register, populated by any delete smaller than one line (e.g. x, dw, d2l) unless you specified a named register
  • Combining them: <C-r>- inserts whatever was last deleted (short deletions only)

The small delete register is separate from the unnamed register "": the unnamed register is updated by every delete and yank, but "- only holds sub-line deletions and is not overwritten by yanks.

Example

You accidentally deleted a word with dw, then continued typing. To recover it:

-- insert mode --
Hello, !          ← you deleted "world" with dw and are now typing
<C-r>-            ← inserts "world" back at cursor
Hello, world!     ← restored

Tips

  • In normal mode, "-p also pastes from the small delete register
  • The small delete register is not affected by yanks, making it more predictable than "" after copy-paste workflows
  • <C-r>0 (yank register) and <C-r>" (unnamed register) are similarly useful insert-mode paste shortcuts

Next

How do I sort lines by their numeric value instead of alphabetically?