I love vim, but one common gotcha is:
- yank a line
- go to where you would like to paste it
- delete what’s there
- paste your yank, only to discover that it pastes what you just deleted
Obviously the workflow is delete first, yank second. But it would be reeeeeaaaaaalllly nice if I didn’t have to. Anyone have a trick for this? Does vim have a paste buffer that works well, or is there a .vimrc setting I can change?
Pass to the
_register, the black hole.To delete a line without sticking it in the registers:
See also
:help registers.It’s probably safest, if you want to paste something over and over again, to yank it into a “named” register.
Yanks a line into the
aregister. Paste it with"ap.