How do I convert selected text to lowercase in visual mode?
u (in visual mode)
In visual mode, pressing u converts all selected text to lowercase.
u (in visual mode)
In visual mode, pressing u converts all selected text to lowercase.
visual select + d, move, P
To swap two pieces of text, delete the first selection, navigate to the second, select it, and paste.
>
In visual mode, pressing > indents all selected lines by one shiftwidth.
J (in visual mode)
In visual mode, pressing J joins all selected lines into a single line with spaces between them.
<C-v>selection r{char}
In visual block mode, pressing r followed by a character replaces every character in the selected rectangle with that character.
v
The v command enters character-wise visual mode, letting you select text one character at a time.
<C-v>jj$A
Combining visual block mode with $ and A lets you append text at the end of multiple lines, even when the lines have different lengths.
<C-v>selection c
In visual block mode, pressing c changes (replaces) all the text in the selected rectangle.
<C-v>jjI1. <Esc>
Visual block insert can add numbered prefixes to lines.
y/<C-r>"<CR>
To search for the exact text you have selected in visual mode, yank it and paste it into the search prompt.
`< and `>
The ` ` marks automatically track the boundaries of the last visual selection.
<C-v>jj"ay then "ap
How it works Vim registers remember not just the text content but also the type of selection that was used to yank it: characterwise, linewise, or blockwise.
:set wrap! or :set nowrap
How it works By default, Vim wraps long lines that extend past the window width, displaying them across multiple screen lines.
:'<,'>w filename
How it works Vim's :w command can take a range, and when used with a visual selection, it writes only the selected lines to a file.
:'<,'>!command
How it works Vim can pipe selected text through any external shell command, replacing the selection with the command's output.
:'<,'>g/pattern/command
How it works The :g (global) command is one of Vim's most powerful features.
:'<,'>copy'>
How it works The :copy command (or its abbreviation :t) duplicates lines to a specified destination.
v%
How it works The % motion jumps to the matching bracket, parenthesis, or brace.
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
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