vim copy paste registers

vim_compThere’s an excellent way of storing yanked buffers in vim using numbered registers and named registers giving you a total of 36 buffers to bookmark your copied information and remember them as long as you don’t use the same register once again. This extends the regular yy/cc/dd/p/P… combinations that we use to yank/paste the default register.

numbered registers: "0 to "9 (total 10)
named registers: "a to "z OR "A to "Z (total 26)

Usage (applies to all the shortcuts yy, cc, dd, p, P):

  1. to copy 10 lines from the current line into the named register a, press "a10yy in vim command mode. Same for numbered registers, just replace a with the number of choice, for example "710yy.
  2. to paste the buffered line(s), paste "ap or "7P etc. again in the command mode.

Wait! There are some special registers too:

"" : the last defined register
": : the last entered command
"% : name of the file currently opened
"* : copy to system clipboard (X)
"+ : similar to "*

To see all the currently set registers, use :reg. To know more about registers type in

:help registers

2 thoughts on “vim copy paste registers”

Leave a Reply

Your email address will not be published. Required fields are marked *