How do I paste or reuse my last search pattern from the search register?
Vim stores the last search pattern in the search register "/.
category:
registers
tags:
#registers
#search
#editing
How do I paste the last yanked text while in Insert mode without using the unnamed register?
In Insert mode, {reg} pastes the contents of any register inline at the cursor.
category:
registers
tags:
#registers
#insert-mode
#editing
How do I insert the result of a Vim expression onto a new line in the buffer?
The :put command inserts the contents of a register as a new line below the cursor.
category:
registers
tags:
#registers
#ex-commands
#editing
How do I assign a macro to a register directly from the command line without recording it?
You can assign a string directly to any register using :let @{reg} = '.
category:
macros
tags:
#macros
#registers
#ex-commands
How do I paste my last Ex command into the command line or a buffer?
Vim stores your last executed Ex command in the read-only : register.
category:
registers
tags:
#registers
#ex-commands
#command-line
How do I edit a recorded macro without re-recording it from scratch?
Macros are stored as plain text in named registers.
category:
macros
tags:
#macros
#registers
#editing
How do I execute a Vimscript expression as a macro without recording it?
The @= command lets you type a Vimscript expression and execute the result as if it were a macro.
category:
macros
tags:
#macros
#registers
#ex-commands
How do I insert the word under the cursor into the Vim command line?
When typing a command on the Vim command line, pressing inserts the word currently under the cursor.
category:
registers
tags:
#command-line
#registers
#editing
How do I edit a recorded macro to fix a mistake without re-recording it?
When a macro has a small mistake, re-recording the entire thing is tedious.
category:
macros
tags:
#macros
#registers
#editing
How do you assign text to a register using :let?
Use :let @a = 'text' to set register a to any string.
category:
registers
tags:
#registers
#let
#assign
How do you yank the same text to multiple registers?
Yank the line twice into different registers.
category:
registers
tags:
#registers
#multiple
#yank
How do you yank a single word into a named register?
Use "a to specify register a, then yiw to yank the inner word.
category:
registers
tags:
#registers
#yank
#word
How do you yank lines between two marks into a register?
Set marks with ma and mb, then yank the range between them into register a using "a:'a,'by.
category:
registers
tags:
#registers
#marks
#yank
How do you yank an entire paragraph into a named register?
Use "ayip to yank the inner paragraph into register a.
category:
registers
tags:
#registers
#yank
#paragraph
How do you yank a sentence into a named register?
Use "ayis to yank the inner sentence into register a.
category:
registers
tags:
#registers
#yank
#sentence
How do you yank a visual block selection to a register?
Enter visual block mode with , select the block, then "ay to yank the block into register a.
category:
registers
tags:
#registers
#block
#yank
How do you yank the entire file contents into a register?
Go to the first line with gg, then visually select from there to the last line with VG, and yank into register a.
category:
registers
tags:
#registers
#yank
#entire-file
How do you yank an entire function body into a register?
Position cursor in a function, use VaB to visually select the block including braces, then "ay to yank into register a.
category:
registers
tags:
#registers
#yank
#function
How do you use text from one register inside a macro?
While recording macro a, paste from register b with "bp.
category:
registers
tags:
#registers
#macro
#paste
How do you use a register value in a substitute command?
In command-line mode, a inserts the contents of register a.
category:
registers
tags:
#registers
#substitute
#search