devroom.io/drafts/2010-08-09-using-multiple-clipboards-in-vim.md
Ariejan de Vroom dbae98c4c0 Moar updates
2013-03-24 14:27:51 +01:00

1.2 KiB

title kind slug created_at tags
Using multiple clipboards in Vim article using-multiple-clipboards-in-vim 2010-08-09
vi
vim

On of the first things you learn when using Vim activly is that when you delete something using x or dd that content is actually cut and put on a clipboard. Later you can retrieve that content using the p or P commanands.

One thing that makes Vim more awesome than let's say, uhm TextMate, is that it actually has more than one clipboard! Yeah! In fact, in Vim terminology those clipboards are called registers. ~

To view your current registers type :reg. You'll notice that every register is prefixed with the symbol ".

How do you use these things? Let's say you want to copy a line into a specific register: "kyy will yank the current line into register "k. If you later want to paste register "k you can do this: "kp. Easy, huh?

The beauty of registers is that they keep around until you explicitly copy something else into them. The normal clipboard or paste buffer is replaced everytime you cut or copy something, registers are not affected unless you specify to use them.

Now, go on, code more productively.