LOGBOOK

HELP

Quiz Entry - updated: 2026.07.14

How do you copy and paste in VIM?

Copy = "yank" (yy for a line), paste = "put" (p after the cursor) — vim's words for clipboard operations.

The terminology trips people up: in vim yank means copy and put means paste. Like delete, y is an operator that pairs with motions — yw yanks a word, y$ to end of line, 3yy three lines.

Yank (copy) commands:

Command Copies
yy Entire line
yw Word
y$ To end of line
3yy 3 lines

Put (paste) commands:

Command Pastes
p After cursor/below line
P Before cursor/above line

Workflow example:

yy      " Yank current line
jjj     " Move down 3 lines
p       " Paste below current line

Using Visual mode:

  1. Press v to start selection
  2. Move cursor to select text
  3. Press y to yank
  4. Move to destination
  5. Press p to paste

Go deeper:

From Quiz: LIOS / Reading and Editing Files from the Command Line | Updated: Jul 14, 2026