How do I yank text inside delimiters into a specific named register?
"ayi(
Combining named registers with text object motions lets you precisely yank structured content — like function arguments, quoted strings, or bracketed expressi
"ayi(
Combining named registers with text object motions lets you precisely yank structured content — like function arguments, quoted strings, or bracketed expressi
:nnoremap <leader>d "=strftime('%Y-%m-%d')<CR>p
The expression register (=) evaluates Vimscript expressions and uses the result as register content.
:echo @%
Vim provides special read-only registers that hold the current and alternate filenames.
@a (within macro @b)
Vim macros can call other macros, enabling modular macro composition.
:put =map(getreg('a', 1, 1), 'toupper(v:val)')
By using getreg() with the list flag and applying map(), you can transform register contents with any Vimscript function before pasting.
<C-r><C-r>a
In insert mode, a pastes register a but processes the text as if typed, which can trigger abbreviations and mappings.
:let @a = ''
Registers persist their contents throughout your Vim session and even across sessions if viminfo or shada is enabled.
:call setreg('a', @a, 'l')
Registers in Vim have a type — characterwise, linewise, or blockwise — that affects how their contents are pasted.
<C-r>=system("date")<CR>
The expression register (=) is one of Vim's most powerful yet underused features.
:let @+ = expand('%:p')
Sometimes you need to share or use the full path of the file you're editing — for a terminal command, a config file, or a chat message.
<C-r><C-o>{register}
The standard {reg} pastes register contents in Insert mode, but Vim may auto-indent multi-line text to match the current indentation level — sometimes manglin
"/p
Vim stores the last search pattern in the search register "/.
<C-r>0
In Insert mode, {reg} pastes the contents of any register inline at the cursor.
:put ={expression}
The :put command inserts the contents of a register as a new line below the cursor.
<C-r>:
Vim stores your last executed Ex command in the read-only : register.
<C-r><C-w>
When typing a command on the Vim command line, pressing inserts the word currently under the cursor.
:let @a = 'hello world'
Use :let @a = 'text' to set register a to any string.
"ayy"byy
Yank the line twice into different registers.
"ayiw
Use "a to specify register a, then yiw to yank the inner word.
"a:'a,'by
Set marks with ma and mb, then yank the range between them into register a using "a:'a,'by.