1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [yy (yank line)](<https://delaparra-services.nl/knowledge-hub/yy-yank-line>)

  

Category: Keyboard shortcuts 

# yy (yank line)

  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    

## 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](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/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[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026

 

## More Keyboard shortcuts terms

 

- [Step Out](<https://delaparra-services.nl/knowledge-hub/step-out>) 
- [Step Over](<https://delaparra-services.nl/knowledge-hub/step-over>) 
- [Toggle Breakpoint](<https://delaparra-services.nl/knowledge-hub/toggle-breakpoint>) 
- [Toggle Integrated Terminal](<https://delaparra-services.nl/knowledge-hub/toggle-integrated-terminal>) 
- [Toggle Line Comment](<https://delaparra-services.nl/knowledge-hub/toggle-line-comment>) 
- [Toggle Sidebar](<https://delaparra-services.nl/knowledge-hub/toggle-sidebar>)

 

[All terms starting with Y](<https://delaparra-services.nl/knowledge-hub#letter-y>)

 

## Skills

 

- ### Editor shortcuts (VS Code / Cursor and Vim)

 

Use when a user asks how to do something faster in VS Code (or Cursor) or Vim, asks what a keyboard shortcut does (e.g. Ctrl+D, Ctrl+Shift+P, F12, gg, dd, yy, ciw, :wq), wants to customise keybindings, or is stuck in Vim. Gives the correct shortcut for their operating system and can write keybindings.json entries.

 [View skill](<https://delaparra-services.nl/skills/editor-shortcuts>) [Download zip](<https://delaparra-services.nl/skills/editor-shortcuts/download>)

 

## Manuals

 

- [Keyboard shortcuts in VS Code and the terminal](<https://delaparra-services.nl/manuals/sneltoetsen-in-vs-code>) 
- [Installing Visual Studio Code](<https://delaparra-services.nl/manuals/visual-studio-code-installeren>)

 

## 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.

  [Get in touch](<https://delaparra-services.nl/availability>)

[HTML version](https://delaparra-services.nl/knowledge-hub/yy-yank-line)
