How do you delete text without affecting any register?
"_dd
Use the black hole register " before a delete command.
43 results for "dd"
"_dd
Use the black hole register " before a delete command.
dd
The dd command deletes the entire current line, regardless of where the cursor is positioned on that line.
:let @q='commands'
Macros in Vim are stored in registers as plain text.
:g/pattern/normal dd
The :g/pattern/normal {commands} command executes normal mode keystrokes on every line in the file that matches the given pattern.
:let @q =
Instead of recording a macro with q, you can assign any string directly to a named register using :let @{register} = 'keys'.
"_d
The "d command deletes text using the black hole register ("), which discards the deleted content instead of storing it.
:help topic
Vim has an extensive built-in help system.
qaddpq
Record a macro that deletes the current line with dd and pastes it below the next line with p.
:setlocal nomodifiable
While :set readonly prevents accidental writes, nomodifiable goes further by preventing any changes to the buffer contents entirely.
buffers-windows #buffers-windows #readonly #modifiable #protection
P
The P (uppercase) command pastes the contents of the default register before the cursor position.
:{range}normal {commands}
The :normal command executes normal mode keystrokes from the command line.
command-line #command-line #ex-commands #editing #normal-mode
p
The p command pastes (puts) the contents of the default register after the cursor.
:move +1 / :move -2
The :move command relocates lines to a specific position without using delete and paste.
qa/pattern<CR>dd@aq
By starting a macro with a search command, the macro becomes conditional — it jumps to the next match before acting, and terminates when no more matches are f
:let g:debug_macro=1 | normal @a
When a macro doesn't work as expected, debugging it step by step is essential.
:m +1
The :move command (abbreviated :m) relocates lines to a new position in the buffer without touching any registers.
"0p
Register 0 (the yank register) always contains the text from your most recent yank command — and unlike the unnamed register, it is never overwritten by delet
"-p
The small delete register ("-) captures text from delete operations that are less than one line — like dw, x, dt.
:put a ... edit ... "ayy
Recorded macros are stored as plain text in registers, but editing them by re-recording is tedious for complex sequences.
"add
How it works When you delete text in Vim with commands like dd, dw, or x, the deleted text goes into the unnamed register and the numbered registers (1-9).