Skip to content
Vim Learn
Learn/

Copy and Paste Lines

17 / 51

Basic Operators

Copy and Paste Lines

Yank lines and place them above or below the cursor.

yy writes a complete line to the unnamed register. p places linewise text below the cursor and P places it above.

Use yy, p, and P in the editor beside this lesson. The challenge proves it once; Practice is a timed run against the clock.

Keys in this lesson

yy
Yank the whole line
p
Paste after the cursor, or below for a whole line
P
Paste before the cursor, or above for a whole line
All 91 keys →

Practice against the clock.

The challenge proves completion once. Practice is a timed run of 15 goals — beat par, then beat your own best time. Every completed goal saves locally.

yyP

Yank the second line and paste it above.