Reindent an inner paragraph
=ip
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 1, column 1Recalculate indentation for the paragraph.
Waiting for motion or text object
Recalculate indentation for the paragraph
Before & after
{
one
two
}
keepCursor on line 2, column 3{
one
two
}
keepCursor on line 1, column 1Start in Normal mode. C indentation is enabled with expandtab and shiftwidth=2.
Details & Vim help
Example replayed in Vim
Recalculate indentation for the paragraph.
ip selects the paragraph without surrounding blank lines. = uses the active indentation rules or equalprg, so output depends on filetype and configuration. Use gq for text wrapping.