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.
30 results for "indent visual"
>gv
Normally, pressing > in visual mode indents the selection but exits visual mode, requiring you to press gv to reselect.
vii with indent-object plugin
The vim-indent-object plugin provides ii (inner indent) and ai (around indent) text objects.
>
In visual mode, pressing > indents all selected lines by one shiftwidth.
> 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
>>
The >> command shifts the current line one shiftwidth to the right, adding indentation.
gv
The gv command reselects the exact same area that was last selected in visual mode.
=i{ or =ap
The = operator performs smart indentation based on Vim's filetype-aware indent rules.
=
Pressing = in visual mode auto-indents the selected lines according to Vim's built-in indentation rules.
visual-mode #editing #visual-mode #indentation #formatting #productivity
gg=G
The gg=G command re-indents every line in the current file according to Vim's indentation rules.
ii / ai
The vim-indent-object plugin by Michael Smith adds text objects based on indentation level, giving you ii (inner indent) and ai (an indent) to select, delete, c
= (in visual mode)
After making a visual selection, pressing = applies Vim's auto-indent to every selected line at once.
V
The V (uppercase) command enters visual line mode, which selects the entire current line.
zf / zo / zc / za
Vim's folding system lets you collapse blocks of code into a single line, hiding the details so you can focus on the structure.
editing #editing #folding #navigation #normal-mode #productivity
Va{ or Vi{
The a{ (around braces) and i{ (inside braces) text objects combined with visual mode let you instantly select an entire function body or code block, regardless
visual-mode #visual-mode #text-objects #code-navigation #selection
`[v`]
The ` [v] sequence visually selects the exact region of text that was last changed, pasted, or yanked into the buffer.
visual-mode #editing #visual-mode #marks #paste #productivity
v + repeated iw/aw/i(/a(/ip/ap
Once you enter visual mode, you can progressively expand your selection by typing increasingly larger text objects.
visual-mode #visual-mode #text-objects #editing #selection #productivity
gg
The gg command moves the cursor to the first line of the file.
:set breakindent
When wrap is enabled, long lines wrap to the next screen row starting at column 1 by default, which makes indented code look messy.
:%!
The ! operator pipes text through a shell command, replacing the selected lines with the command's output.
==
The == command auto-indents the current line based on the surrounding context.