I'm learning to like vim, but one thing that I haven't yet fully embraced is the copy and paste situation. In a muggle text editor I would Ctrl–C copy a piece of text and then edit/delete and then paste the text somewhere else. However in vim I can't do this because after I copy text with y, modifying the text often involves d and x which obliterates my original text.
Is there any way to make d and x not copy the text? Or otherwise, how should I be using these vim features?
Best Answer
The 9 previous yanks are saved in registers called
1
through9
. You can recall the next-to-last yank with"1p
, the previous one with"2p
and so on. The command:reg
shows the registers that are available for pasting.If you want a yank to last longer, use a letter register.
For the more obscure yank-related commands, start reading at
:help "
in the manual.