Vim: Registers (/delete registers) ...are great
When you delete something (
x amongst others) that goes into the delete "register". You can paste that somewhere else with
p. That's like cutting text in others editors.
There's a problem. Say you delete some text you want to paste somewhere else. But, before you paste, you see some other text and you delete that. Now that other text is cut--obliterating your formally "cut" text.
Vim has other registers: locations where it stores text. When you normally delete or copy text (
yy etc) that goes into the default register. And when you paste text (
P), that is pasted from the default register.
You can specify other registers with, for example,
"a. In this case
a is just a name of a register.
"add deletes the line into register
"ap pastes that line from register
So you see some text you want to "cut" somewhere else. You press
"add. Now you carry on deleting text with
dd etc. And finally when you want to paste that formally "cut" text you type
If you want to add text to an existing register, use the uppercase version of the register.
"Add will delete a line into the existing
:reg to see all the registers. Registers 0 to 9 are your formally cut text. Register persist between editor quits.