How do you delete text without affecting any register?
"_dd
Use the black hole register " before a delete command.
9 results for "black hole register"
"_dd
Use the black hole register " before a delete command.
"_d
The "d command deletes text using the black hole register ("), which discards the deleted content instead of storing it.
"_dP in visual mode
Use "_dP which deletes the selection into the black hole register and pastes before.
:let @a = ''
Registers persist their contents throughout your Vim session and even across sessions if viminfo or shada is enabled.
dd
The dd command deletes the entire current line, regardless of where the cursor is positioned on that line.
"ayv
Using named registers with visual mode lets you store multiple independent snippets simultaneously.
"0p in visual mode
When you paste over a visual selection with p, Vim replaces the selection with the register contents — but it also puts the deleted selection into the unnamed
:help registers
Vim has 10 types of registers, each serving a specific purpose.
let mapleader = ' ' then nnoremap <leader>key command
The leader key is a configurable prefix for your custom key mappings.