DEV Community

Colin Bartlett
Colin Bartlett

Posted on • Originally published at vimtricks.substack.com

3 2

VimTrick: The clipboard register

Ever need to copy something into and out of Vim? There's a built-in way to do that and it's called the * (star) register. The star register is a register like any other in Vim but it's contents are that of your system clipboard.

You can get data out of Vim by putting it on your system clipboard:

  • “*yy - Yank the current line into your * register, the system clipboard
  • “*yap - Yank Around Paragraph: copies the whole paragraph, method, or function

And you can get data out of system and into Vim by pasting it from your system clipboard:

  • “*p - Paste from the system clipboard below the current line
  • “*P - Paste from the system clipboard above the current line

I've got a full write up and a short screencast over on VimTricks.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay