How do I indent lines multiple times without reselecting in visual mode?
>gv
Normally, pressing > in visual mode indents the selection but exits visual mode, requiring you to press gv to reselect.
23 results for "gv"
>gv
Normally, pressing > in visual mode indents the selection but exits visual mode, requiring you to press gv to reselect.
gv
The gv command reselects the exact same area that was last selected in visual mode.
:'<,'>m'>+1
The :m command with the visual range moves selected lines.
:move +1 / :move -2
The :move command relocates lines to a specific position without using delete and paste.
:'<,'>move'>+1 or :'<,'>move'<-2
How it works Vim's :move command lets you relocate lines to a different position.
> and <
How it works In visual mode, you can shift selected lines to the right or left using the > and to indent them or or shifts the selected lines one shiftwidth to
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.
>
In visual mode, pressing > indents all selected lines by one shiftwidth.
v
The v command enters character-wise visual mode, letting you select text one character at a time.
`< and `>
The ` ` marks automatically track the boundaries of the last visual selection.
<C-v>jjI1. <Esc>
Visual block insert can add numbered prefixes to lines.
y (in visual mode)
In visual mode, pressing y yanks (copies) the selected text into the default register.
<C-v>j$A;<Esc>
When lines have varying lengths, a normal visual block selection stops at the shortest line.
<C-v>jjxp
Visual block mode lets you select, cut, and paste rectangular columns of text.
:'<,'>sort
The :'sort command sorts the currently selected lines in visual mode alphabetically.
:'<,'>s/\%Vpattern/replacement/g
When you press : after making a visual selection, Vim inserts ' to restrict the substitution to the selected lines.
visual-mode #visual-mode #search #editing #ex-commands #normal-mode
o (in Visual mode)
When you make a Visual selection in Vim, the cursor sits at one end while the other end is anchored.
:'<,'>s/pattern/replacement/g
When you make a visual selection and then type :, Vim automatically inserts ' as the range — the marks for the start and end of the last visual selection.
o (visual mode)
In visual mode, pressing o swaps the cursor between the two ends of the selection (the anchor and the free end).
V
The V (uppercase) command enters visual line mode, which selects the entire current line.