How do I make % jump between matching HTML tags and language keywords like if/end?
packadd matchit
Vim ships with matchit.
packadd matchit
Vim ships with matchit.
ysiw"
The ysiw" command wraps the word under the cursor in double quotes using the vim-surround plugin.
vip=
Pressing = in visual mode re-indents all selected lines according to the current filetype's indent rules — the same engine used by == for a single line, but a
visual-mode #visual-mode #indentation #editing #text-objects
:packadd matchit
The matchit plugin ships with Vim and Neovim but is not enabled by default.
g~~
Vim has three case-change operators that work like any other operator — you can combine them with motions, text objects, or double them to act on the whole li
visual-mode #editing #visual-mode #normal-mode #text-objects
gwip
The gw operator reformats text just like gq, but leaves the cursor in its original position after reformatting.
:set iskeyword+=-
By default, Vim treats hyphens, dots, and many punctuation characters as word boundaries.
<C-v>jjlU
Visual block mode lets you select rectangular regions of text, which means you can target a specific column and apply case changes only to that area.
=i{
When editing code with messy indentation — after a paste, a merge conflict, or a refactor — you often need to fix just one block rather than the entire file
:g/pattern/m 0
The :global command combined with :move lets you restructure a file by relocating all lines that match a pattern.
gq
The gq operator reformats text to fit within your configured textwidth.
:set operatorfunc=MyFunc<CR>g@
Vim lets you define custom operators that behave like built-in ones (d, c, y) — they wait for a motion or text object, then act on the selected region.
gqap
The gq operator reformats text by wrapping lines to fit within the textwidth setting.
v3aw
In visual mode, repeating text object motions progressively expands the selection.
"ayi(
Combining named registers with text object motions lets you precisely yank structured content — like function arguments, quoted strings, or bracketed expressi
:TSTextobjectSelect @function.outer
The nvim-treesitter-textobjects plugin provides syntax-aware text objects powered by Treesitter's AST parsing.
cia (with targets.vim) or daa
While Vim doesn't have a built-in argument text object, the targets.
vaB
The aB text object (around Block) selects everything from the matching { to the closing } — including the braces themselves.
vis
The is (inner sentence) text object selects the sentence the cursor is in — excluding any leading or trailing whitespace that separates sentences.
va"
Vim's text objects let you select structured regions of text with two-keystroke shortcuts.