← All lessons

6. Copying And Pasting

Step 5 of 7

Named registers

In Vim, registers are denoted with a quote — for example, the default register is denoted "", and the ‘a’ register "a.

Vim has 26 so-called “named registers” — one for each letter in the alphabet. What this means is that Vim essentially has 26 separate clipboards that you can use to store whatever you want. It is completely up to you to decide how to use them!

This is vastly superior to other editors, which typically don’t have any registers, and force you to rely on the system clipboard instead.

To access a register — say the "a register — you just type "a before a command. For example, "ayy will yank the current line under the cursor to the "a register, and "ap will put the contents of the "a register into the file.

For completeness, typing just yy is the exact same as typing ""yy to yank into the unnamed register.

Give it a try in the editor. Try yanking each of the lines into the appropriate named registers, then putting them back in a different order.

Loading editor…