How do I convert selected text to uppercase?
U (in visual mode)
In visual mode, pressing U converts all selected text to uppercase.
260 results for "visual mode"
U (in visual mode)
In visual mode, pressing U converts all selected text to uppercase.
~ (in visual mode)
In visual mode, pressing ~ toggles the case of every character in the selection.
u (in visual mode)
In visual mode, pressing u converts all selected text to lowercase.
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, press o to move the cursor to the opposite end of the selection.
`< and `>
The ` ` marks automatically track the boundaries of the last visual 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.
gv
The gv command reselects the exact same area that was last selected in visual mode.
V
The V (uppercase) command enters visual line mode, which selects the entire current line.
v
The v command enters character-wise visual mode, letting you select text one character at a time.
O in visual block mode
In visual block mode (), pressing O (uppercase) moves the cursor to the diagonally opposite corner of the rectangular selection.
d in visual mode
Select text visually and press d to delete the selection.
S"
The vim-surround plugin provides the S command in visual mode to wrap any selection with a delimiter pair.
:%s/\%Vpattern/replacement/g
The \%V atom restricts a regex match to the last visual selection — more precisely than :'s/.
:'<,'>s/\%Vold/new/g
The \%V atom restricts a search pattern to match only within the visual selection area, including visual block selections.
"ap
In visual mode, "ap replaces the selected text with the contents of register a.
o (in visual mode)
While in visual mode, pressing o swaps the cursor to the opposite end of the selection.
v$
Press v to enter character-wise visual mode, then $ to extend selection to the end of the line (excluding the newline).
v'a
Press v for visual mode, then 'a to extend the selection to mark a.
gq in visual mode
Select text with v or V, then press gq to format the selection according to textwidth.