Vim provides many registers. We can use these registers as multiple clipboards. This feature is really useful while working with multiple files. In this chapter, we will discuss following items −
For copying, we can use normal yank command i.e. yy and to store it in register we can use following syntax −
For instance, to copy text in register “a” use following command −
To paste text from register use −
For instance, below command copies text from register “a” −
To list all available registers use following command
Vim supports following types of registers −
Unnamed register is denoted by “”. Vim stores deleted or copied text in this register
We can use 26 named registers; we can use a-z or A-Z. By default vim doesn’t uses these registers.
If we use lower case register name then contents will be overwritten and if we use uppercase name then contents will be appended in that register.
We can use 0 to 9 named registers. Vim fills these registers with text from yank and delete command.
Following are the default registers −
|Sr.No||Register & Description|
Name of the current file
Name of the alternate file for the current window
Most recently executed command
Contains the last inserted text
Last used register