How do I quickly change the text between any pair of delimiters?
ci" / ci( / ci{ / ci[ / ci` / ci'
The ci{delimiter} family of commands changes the text inside any matching pair of delimiters.
category:
editing
tags:
#editing
#text-objects
#change
#delimiters
#normal-mode
How do I target outer nested brackets using counted text objects?
Vim text objects accept a count prefix that lets you target outer layers of nested delimiters.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#advanced
How do I create custom text objects for my own operator-pending motions?
onoremap ih :<C-u>execute "normal! ?^==\+$\r:noh\rkvg_"<CR>
Vim lets you define custom text objects using operator-pending mode mappings (onoremap) and visual mode mappings (vnoremap).
category:
config
tags:
#config
#text-objects
#mappings
#vimrc
#advanced
How do I get more powerful text objects for quotes, brackets, and arguments in Vim?
The targets.
category:
plugins
tags:
#plugins
#targets
#text-objects
#editing
#motions
How do I select or operate on a block of code based on its indentation level in Vim?
The vim-indent-object plugin by Michael Smith adds text objects based on indentation level, giving you ii (inner indent) and ai (an indent) to select, delete, c
category:
plugins
tags:
#plugins
#indent
#text-objects
#editing
#python
How do I get improved % matching for language keywords like if/else/endif in Vim?
The vim-matchup plugin by Andy Massimino is a drop-in replacement for Vim's built-in matchit plugin that supercharges the % key to work with language-specific k
category:
plugins
tags:
#plugins
#matchup
#navigation
#text-objects
#matching
How do I quickly change surrounding quotes, brackets, or tags in Vim?
The vim-surround plugin by Tim Pope lets you change any surrounding delimiter pair with a single cs command.
category:
plugins
tags:
#plugins
#surround
#editing
#text-objects
#normal-mode
How do I quickly delete surrounding quotes, brackets, or tags in Vim?
The vim-surround plugin provides the ds command to instantly delete any surrounding delimiter pair.
category:
plugins
tags:
#plugins
#surround
#editing
#text-objects
#normal-mode
How do I wrap a word or text object with quotes, brackets, or tags in Vim?
The vim-surround plugin provides the ys (you surround) operator to wrap any Vim text object or motion with a delimiter pair.
category:
plugins
tags:
#plugins
#surround
#editing
#text-objects
#normal-mode
How do I swap two text regions without using a temporary register in Vim?
The vim-exchange plugin by Tom McDonald provides the cx operator to swap two arbitrary text regions.
category:
plugins
tags:
#plugins
#exchange
#editing
#text-objects
#refactoring
How do I quickly surround a word with quotes, brackets, or parentheses?
Vim doesn't have a built-in "surround" operator, but you can wrap any word in quotes or brackets with a short sequence: ciw""P.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#productivity
#surround
How do I toggle the case of an entire word in Vim?
The g~iw command toggles the case of every character in the word under the cursor — uppercase letters become lowercase and vice versa.
category:
editing
tags:
#editing
#text-objects
#case
#normal-mode
How do I expand or shrink a visual selection to the next text object boundary?
v + repeated iw/aw/i(/a(/ip/ap
Once you enter visual mode, you can progressively expand your selection by typing increasingly larger text objects.
category:
visual-mode
tags:
#visual-mode
#text-objects
#editing
#selection
#productivity
How do I delete or change an entire paragraph of text in one motion?
The dap and dip commands use Vim's paragraph text objects to delete an entire block of contiguous text in a single motion.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#delete
#motions
How do I quickly delete all the arguments inside a function call?
The di( command deletes everything inside the nearest pair of parentheses without removing the parentheses themselves.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#delete
#code
How do I change the content between HTML tags without manually selecting it?
The cit command deletes everything between the nearest pair of HTML/XML tags and drops you into insert mode, ready to type the replacement.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#html
#tags
How do I quickly replace the text inside quotes without manually selecting it?
The ci" command deletes everything inside the nearest pair of double quotes and drops you into insert mode, ready to type the replacement.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#productivity
How do I quickly change an entire sentence in Vim?
The cis command deletes the entire sentence under the cursor and drops you into insert mode, ready to type a replacement.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#motions
#prose
How do I change text from the cursor up to a specific character?
The ct{char} command deletes everything from the cursor up to (but not including) the specified character and drops you into insert mode.
category:
editing
tags:
#editing
#motions
#normal-mode
#text-objects
#productivity
What is the difference between cw and ciw when changing a word?
The cw and ciw commands both change a word, but they behave differently depending on cursor position.
category:
editing
tags:
#editing
#text-objects
#motions
#normal-mode
#productivity