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:
- Press
vto start selection - Move cursor to select text
- Press
yto yank - Move to destination
- Press
pto paste
Go deeper:
Vim help: change.txt — yank and put (vimhelp.org) —
yy/yw(yank) andp/P(put) and how registers connect them.