How do I visually select an entire sentence in Vim?
vas
The vas command visually selects the current sentence, including surrounding whitespace.
vas
The vas command visually selects the current sentence, including surrounding whitespace.
cs'"
The vim-surround plugin (by Tim Pope) adds three powerful operators for working with surrounding delimiters — quotes, brackets, parentheses, and HTML tags.
vi<
The vi).
"adiw
The "adiw command deletes the inner word under the cursor and stores it in register a.
ci`
The ` ci ` command changes the text inside backtick delimiters.
cs"' (change), ds" (delete), ys iw" (add)
The vim-surround plugin by Tim Pope adds commands for working with surrounding characters like quotes, brackets, and tags.
qa ci"replacement<Esc> /next<CR> q
Macros can contain any Vim command including text objects, searches, and multi-key motions.
vi{a{
In visual mode, you can expand your selection to include outer nested blocks by pressing additional text object commands.
vi[
The vi[ command selects the text inside square brackets without including the brackets themselves.
dip
The dip command deletes the inner paragraph — all contiguous non-blank lines surrounding the cursor.
(
The ( motion moves the cursor backward to the start of the current or previous sentence.
)
The ) motion moves the cursor to the beginning of the next sentence.
yiw
How it works The command yiw yanks (copies) the inner word under the cursor.
viw
How it works The command viw selects the word under the cursor in visual mode.
Va{ or Vi{
The a{ (around braces) and i{ (inside braces) text objects combined with visual mode let you instantly select an entire function body or code block, regardless
visual-mode #visual-mode #text-objects #code-navigation #selection
Treesitter incremental selection with grn/grc
nvim-treesitter provides incremental selection that expands based on the syntax tree rather than simple text patterns.
=i{ or =ap
The = operator performs smart indentation based on Vim's filetype-aware indent rules.
gU{motion} / gu{motion} / g~{motion}
Vim has three case operators that work with any motion or text object: gU for uppercase, gu for lowercase, and g~ for toggle case.
editing #editing #case #operators #text-objects #normal-mode
ggVG
While Vim doesn't have a built-in "entire buffer" text object, the ggVG sequence achieves it: go to the first line, enter line-wise visual mode, then select to
( / ) / { / }
Vim treats sentences and paragraphs as first-class navigation units.
navigation #navigation #motions #text-objects #prose #editing