How do I replace a visual selection with yanked text without losing my clipboard?
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
category:
visual-mode
tags:
#visual-mode
#registers
#paste
#workflow
How do I paste from a register while staying in insert mode?
Pressing followed by a register name in insert mode inserts the contents of that register at the cursor position without leaving insert mode.
category:
registers
tags:
#editing
#insert-mode
#registers
#productivity
How do I change whether a register pastes as character, line, or block-wise?
:call setreg('"', @", 'l')
Vim registers carry not just their text content but also a type: charwise (c), linewise (l), or blockwise (b).
category:
registers
tags:
#registers
#editing
#normal-mode
#paste
How do I paste the contents of a register literally in command-line mode without interpreting special characters?
In command-line mode, {reg} inserts a register's contents — but it processes certain sequences, potentially misinterpreting backslashes, pipe characters, or e
category:
registers
tags:
#registers
#command-line
#search
#editing
What are Vim's read-only special registers and how do I use them?
". / "% / ": / "# registers
Vim has four read-only special registers that automatically contain useful contextual information.
category:
registers
tags:
#registers
#special-registers
#workflow
#productivity
How do I access my delete history beyond the last delete?
Vim maintains a numbered register history from "1 through "9 that stores your last 9 deletes and changes.
category:
registers
tags:
#registers
#undo-redo
#delete
#history
#paste
How do I always access my last yanked text regardless of deletes?
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
category:
registers
tags:
#registers
#paste
#yank
#workflow
How do I cycle through previously deleted text using numbered registers?
"1p then u then . to cycle
Vim stores your last 9 deletions in numbered registers "1 through "9.
category:
registers
tags:
#registers
#editing
#undo-redo
#delete
#paste
How do I move a column of text to a different position using visual block mode?
Visual block mode lets you select, cut, and paste rectangular columns of text.
category:
visual-mode
tags:
#visual-mode
#block-mode
#columns
#editing
How do I access text from small deletes like dw or x?
The small delete register ("-) captures text from delete operations that are less than one line — like dw, x, dt.
category:
registers
tags:
#registers
#delete
#paste
#normal-mode
How do I swap a word with the contents of a register using visual mode?
The viwp command visually selects the word under the cursor and replaces it with the contents of the unnamed register (your last yank or delete).
category:
visual-mode
tags:
#editing
#visual-mode
#registers
#paste
#productivity
What is the selection register in Vim and how do you use it?
The register represents the primary selection (middle-click paste in X11).
category:
registers
tags:
#registers
#selection
#primary
What is the difference between the star register and the plus register?
How it works Vim has two system clipboard registers that interact with the operating system: " -- the selection register (PRIMARY selection on Linux/X11, clipbo
category:
registers
tags:
#registers
#editing
#config
How do I select the text I just pasted or changed?
The ` [v] sequence visually selects the exact region of text that was last changed, pasted, or yanked into the buffer.
category:
visual-mode
tags:
#editing
#visual-mode
#marks
#paste
#productivity
How do I jump to the start or end of the last changed, yanked, or pasted text using automatic marks?
Vim automatically sets two special marks after every change, yank, or put operation: '[ and '].
category:
navigation
tags:
#marks
#navigation
#editing
#normal-mode
How do I cycle through the numbered delete registers using the dot command?
When you paste from a numbered register with "1p, Vim's dot command (.
category:
registers
tags:
#registers
#editing
#normal-mode
#undo-redo
How do I cycle through numbered registers to find a previous deletion?
Vim stores the last 9 deletions in numbered registers 1-9, with the most recent in register 1.
category:
registers
tags:
#registers
#numbered
#undo
#history
How do I browse and restore previously deleted text using Vim's numbered registers?
"1p then u. to cycle through delete history
Vim silently maintains a rolling history of your last 9 deletions in numbered registers "1 through "9.
category:
registers
tags:
#registers
#editing
#normal-mode
#undo-redo
How do I copy selected text to the clipboard in visual mode?
In visual mode, pressing y yanks (copies) the selected text into the default register.
category:
visual-mode
tags:
#visual-mode
#registers
#editing
How do I edit a recorded macro?
Since macros are stored in registers, you can paste the register content into the buffer, edit it, and yank it back.
category:
registers
tags:
#registers
#macros
#editing