Vim 9 cheatsheet

Vim 9: Copy, paste and undo

8 common Vim 9 tasks.

Copy a line

Copy the current line into the register.

yy

Copy a word

Copy from the cursor to the start of the next word.

yw

Paste after or before

Paste the register after the cursor (or below a line), or before it with a capital P.

p  P

Undo

Undo the last change. Prefix a count to undo several.

u

Redo

Redo a change you just undid.

Ctrl-r

Copy to the system clipboard

Copy the current line to the system clipboard. Needs Vim built with clipboard support.

"+yy

Paste from the system clipboard

Paste the system clipboard after the cursor.

"+p

Show registers

List the contents of all registers.

:registers

Was this page helpful?