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
261 results for ":b#"
"ayi(
Combining named registers with text object motions lets you precisely yank structured content — like function arguments, quoted strings, or bracketed expressi
D
The D command deletes everything from the cursor position to the end of the current line.
:WhichKey
which-key.
:call setreg('a', @a, 'l')
Registers in Vim have a type — characterwise, linewise, or blockwise — that affects how their contents are pasted.
:let @a .= expand('%:t') . "\n"
Named registers are not just for yanks and deletes.
:filter /pattern/ ls
When you have many open buffers, plain :ls output gets noisy fast.
:let @a .= getline('.') . "\n"
Named registers are usually filled with yanks and deletes, but they are also plain variables you can edit with Vimscript.
:lfdo normal! @q | update
When you already have a curated location list, :lfdo lets you apply a change only to those files instead of touching your whole project.
macros #macros #location-list #refactoring #command-line #normal-mode
:setlocal nobuflisted
Setting nobuflisted removes a buffer from the :ls output and buffer-switching commands like :bnext/:bprev, while keeping it loaded and accessible.
buffers-windows #buffers-windows #buffers #unlisted #management
:%s/\w\+/(&)/g
In a Vim substitution, & in the replacement string expands to the entire matched text.
:sb {buffer}
The :sb (short for :sbuffer) command opens a buffer that is already loaded in Vim in a new horizontal split window.
yiww"_ciw\<C-r>0\<Esc>
When you are doing repetitive refactors, cw is fast but it overwrites the unnamed register with the replaced text.
/\S\zs\s\+$
A plain trailing-whitespace search like /\s\+$ also matches fully blank lines, which is noisy when you only want accidental spaces after real content.
]`
Most users jump to marks directly ('a, ` a `), but when a file has many lowercase marks, stepping through them in order is faster than remembering each name.
:lua = {expression}
In Neovim, :lua = expr is a shorthand that evaluates a Lua expression and pretty-prints the result using vim.
:packadd matchit<CR>
The default % motion is great for simple delimiters, but many code structures use semantic pairs like if/else/endif, try/catch, or HTML tags.
:let @q = substitute(@q, '\n', '', 'g')
A common macro failure mode is accidentally hitting while recording.
% with matchit plugin
The % command jumps between matching brackets by default, but with the built-in matchit plugin, it extends to match language-specific keywords like if/else/endi
zm
Instead of jumping between fully open (zR) and fully closed (zM), zm and zr let you step through fold levels one at a time.
let @a = 'sequence'
How it works Macros recorded with q are stored in registers, but they are lost when you close Vim (unless you have the viminfo or shada file preserving them).