How do you select all lines at the same indentation level?
vii with indent-object plugin
The vim-indent-object plugin provides ii (inner indent) and ai (around indent) text objects.
61 results for "indent visual"
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.
>gv
Normally, pressing > in visual mode indents the selection but exits visual mode, requiring you to press gv to reselect.
> 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
vip=
Pressing = in visual mode re-indents all selected lines according to the current filetype's indent rules — the same engine used by == for a single line, but a
visual-mode #visual-mode #indentation #editing #text-objects
=
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
>>
The >> command shifts the current line one shiftwidth to the right, adding indentation.
:set shiftround
shiftround causes indent commands (>, always adds exactly shiftwidth spaces to whatever indentation the line already has With shiftround: > rounds up to the nex
:[range]center / :[range]right / :[range]left
Vim has built-in Ex commands for text alignment: :center, :right, and :left.
==
The == command auto-indents the current line based on the surrounding context.
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.
gv=gv
When you are iterating on indentation, repeating selection steps is wasted motion.
visual-mode #visual-mode #indentation #editing #formatting #workflow
gg=G
The gg=G command re-indents every line in the current file according to Vim's indentation rules.
>%
Vim's > operator (indent) works with any motion or text object — including %, which jumps to the bracket, parenthesis, or brace matching the one under the cur
editing #editing #indentation #text-objects #normal-mode #motions
:set diffopt+=algorithm:histogram,indent-heuristic
Default diff behavior can produce noisy hunks when code is moved or indentation changes significantly.
d'a
Named marks are not just jump destinations — they serve as motion targets for any operator.
navigation #navigation #marks #editing #motions #normal-mode
= (in visual mode)
After making a visual selection, pressing = applies Vim's auto-indent to every selected line at once.
:xmap
:vmap applies to both visual mode and select mode, which can silently break snippet plugins (like UltiSnips, LuaSnip) that use select mode to position the curso
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