DELAPARRA
Index
Color
NL
Category: Keyboard shortcuts

yy (yank line)

Explained by Updated

What is yy (yank line)?

yy (yank line): Vim: copy ("yank") the current line into the register. In Vim, yy yanks, or copies, the current line into a register. Paste it with p below the cursor or P above it. A number in front copies several lines: 5yy copies five. Like other Vim commands, y combines with motions. yw copies a word, y$ copies to the end of the line, and yi" copies everything inside quotes.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about yy (yank line)

What should you keep in mind with yy (yank line)?

Yanked text goes into Vim's own registers, not the system clipboard, unless you use the + register, as in "+yy, or set clipboard=unnamedplus. That is the usual reason copying in Vim seems not to work in other applications. Knowing yy, dd and p already covers most of the copying and moving you need when editing a config file on a server.

At a glance

CategoryKeyboard shortcuts
Explained by
Updated

More Keyboard shortcuts terms

All terms starting with Y

Skills

Manuals

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.