How do I visually select a double-quoted string including the quotes themselves?
va"
Vim's text objects let you select structured regions of text with two-keystroke shortcuts.
va"
Vim's text objects let you select structured regions of text with two-keystroke shortcuts.
vas
The vas command visually selects the current sentence, including surrounding whitespace.
:'<,'>norm @q
When you visually select lines and then type a : command, Vim automatically inserts ' (the visual range marks) into the command line.
<C-v>I#<Esc>
Vim's Visual Block mode lets you prepend characters (like comment markers) to multiple lines simultaneously.
U
In visual mode, pressing U converts all selected characters to uppercase and u converts them to lowercase.
O in visual block mode
In visual block mode (), pressing O (uppercase) moves the cursor to the diagonally opposite corner of the rectangular selection.
vi<
The vi).
~ (in visual mode)
In visual mode, pressing ~ toggles the case of every character in the selection.
zf (in visual mode)
In visual mode, pressing zf creates a manual fold from the selected lines.
:'<,'>m'>+1
The :m command with the visual range moves selected lines.
U (in visual mode)
In visual mode, pressing U converts all selected text to uppercase.
y (in visual mode)
In visual mode, pressing y yanks (copies) the selected text into the default register.
c""<Esc>P
Without a surround plugin, you can manually wrap selected text by changing it, typing the delimiters, and pasting the original text back.
v/pattern<CR>
Starting a search while in visual mode extends the selection to the search match.
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.
:'<,'>normal @q
The :'normal @q command runs macro q on every line of the visual selection.
y/\V<C-r>"<CR>
By yanking a visual selection and pasting it into the search prompt with \V (very nomagic), you can search for exact text including special characters.
<C-v>jjjg<C-a>
Selecting a column of identical numbers with visual block mode and pressing g turns them into an incrementing sequence.
:'<,'>s/\%Vpattern/replacement/g
Using \%V in a substitute pattern restricts matching to within the visual block area only, rather than the full lines.