Reindent inside braces
=i{
Example
Normal 0 / 2Operator pending 1 / 2Normal 2 / 2{
one
two
}
keepCursor on line 2, column 3{
one
two
}
keepCursor on line 2, column 3{
one
two
}
keepCursor on line 2, column 3Recalculate indentation inside a brace block.
Waiting for motion or text object
Recalculate indentation inside a brace block
Before & after
{
one
two
}
keepCursor on line 2, column 3{
one
two
}
keepCursor on line 2, column 3Start in Normal mode. C indentation is enabled with expandtab and shiftwidth=2.
Details & Vim help
Example replayed in Vim
Recalculate indentation inside a brace block.
i{ excludes the outer pair. Vim applies its configured indent behavior to the selected lines; this is not a general code formatter unless equalprg provides one.