How do I count the words, lines, and characters in just my visual selection?
g<C-g> (visual mode)
In visual mode, pressing g reports detailed statistics for the selected text only — word count, character count, and byte count.
432 results for "visual mode"
g<C-g> (visual mode)
In visual mode, pressing g reports detailed statistics for the selected text only — word count, character count, and byte count.
<C-v> (in visual mode)
Once you are in any visual mode, pressing v, V, or switches to charwise, linewise, or blockwise visual mode respectively — without cancelling the current sele
v, V, or Ctrl-V while in visual mode
How it works Vim has three visual modes, and you can switch between them without losing your current selection: v - Characterwise visual mode (select individual
o (in visual mode)
While in visual mode, pressing o swaps the cursor to the opposite end of the selection.
v / V / <C-v> (while in visual mode)
When you are already in visual mode and realize you need a different selection type, you do not have to exit and re-enter.
O (visual block mode)
In visual block mode (), pressing O (uppercase) moves your cursor to the other end of the current line — letting you expand or contract the block's horizontal
U, u, or ~ in visual mode
How it works When you have text selected in visual mode, you can change its case with three simple keys: U - Convert the entire selection to UPPERCASE u - Conve
= (in visual mode)
After making a visual selection, pressing = applies Vim's auto-indent to every selected line at once.
o (in Visual mode)
When you make a Visual selection in Vim, the cursor sits at one end while the other end is anchored.
{Visual}<C-a>
In Visual mode, pressing increments every number within the selection by 1 (or by a given [count]).
r{char} in visual mode
In visual mode, pressing r followed by a character replaces every character in the selection with that single character.
:'<,'>
Vim automatically sets two special marks whenever you make a visual selection: ' (end).
P (in visual mode)
When you paste over a visual selection using p (lowercase), Vim replaces the selection with your register contents — but the replaced text overwrites your unn
"0p in visual mode
When you paste over a visual selection with p, Vim replaces the selection with the register contents — but it also puts the deleted selection into the unnamed
o (visual mode)
In visual mode, pressing o swaps the cursor between the two ends of the selection (the anchor and the free end).
J (in visual mode)
In visual mode, pressing J joins all selected lines into a single line with spaces between them.
C (visual-block)
In visual block mode, pressing C (uppercase) deletes from the leftmost column of the selection to the end of every selected line, then drops you into insert mod
m<
Vim's ' marks record the start and end of the last visual selection and power the ' range used by Ex commands.
>
In visual mode, pressing > indents all selected lines by one shiftwidth.
`< and `>
The ` ` marks automatically track the boundaries of the last visual selection.