How do I delete text without overwriting my current yank register?
Answer
"_d{motion}
Explanation
The black hole register "_ discards anything written to it — it accepts input but produces no output. When you prefix a delete command with "_, the deleted text disappears silently without touching the unnamed register "" or the numbered registers "1–"9. Your previously yanked text stays ready for pasting.
The problem it solves
Vim's normal d (delete) command stores the deleted text in the unnamed register, overwriting your last yank. This is the common frustration when you yank a word, position your cursor, delete the target word, then p — only to paste back the text you just deleted instead of what you yanked.
Solution:
yiw " yank the word you want to paste
...
"_diw " delete the target word — unnamed register untouched
p " paste the originally yanked word
Usage
"_dd— delete a line without saving it to any register"_dw— delete a word silently"_d$— delete to end of line, discarding the text"_c{motion}— change text without clobbering the yank register"_x— delete a single character silently
Tips
- The yank register
"0always holds the last yanked (not deleted) text, making"0pa reliable alternative to using"_for delete-then-paste workflows "_also works withs,c, andxoperators — any command that would normally write to the register- Map a convenient shortcut for frequent use:
nnoremap <leader>d "_d :help registersexplains all register types including the black hole register