How do you replace a column of characters in visual block mode?
<C-v>jjr*
Enter visual block with , select a column with j, press r followed by the replacement character.
<C-v>jjr*
Enter visual block with , select a column with j, press r followed by the replacement character.
c in visual mode
Select text visually, then press c to delete the selection and enter insert mode.
d in visual mode
Select text visually and press d to delete the selection.
<C-v>jjA text <Esc>
Enter visual block with , select lines with j, press A to append after the block.
<C-v>jjI text <Esc>
Enter visual block with , select lines with j, press I to insert before the block.
<C-v>jjg<C-a>
Select a column of identical numbers with , then press g to create an incrementing sequence (1,2,3.
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.