There’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):
- to copy 10 lines from the current line into the named register a, press
"a10yyin vim command mode. Same for numbered registers, just replace a with the number of choice, for example
- to paste the buffered line(s), paste
"7Petc. 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