Shortcut
Vim Copy the Current Line Shortcut
The Vim shortcut to copy the current line is yy on Windows. It's the same on Mac.
Quick Answer
- Windows
- yy
- Mac
- yy
- Web
- Not confirmed yet
VimShortcut
Copy the Current Line
Yanks the whole line into the register.
How to copy the current line in Vim
- Open Vim and go to where you want to copy the current line.
- Press yy on Windows or yy on Mac.
Vim Copy the Current Line Shortcut for Windows
Press yy.
Vim Copy the Current Line Shortcut for Mac
Press yy.
Vim Copy the Current Line Shortcut for Vim Web
We haven't confirmed a Vim Web shortcut for this yet.
Related Keyboard Shortcuts
Frequently asked questions
What is the Vim copy the current line shortcut?
On Windows, press yy. On a Mac, press yy.
Is there a Mac shortcut to copy the current line in Vim?
Yes: yy.
Does it work in Vim for the web?
We haven't confirmed a web version shortcut for this yet.
Official source · How we verify