Vim Recall繁體中文

Reindent an inner paragraph

=ip

Example

Normal 0 / 2
{
 one
   two
}
keep
Cursor on line 2, column 3

Recalculate indentation for the paragraph.

Before & after
Before
{
 one
   two
}
keep
Cursor on line 2, column 3
After
{
  one
    two
}
keep
Cursor on line 1, column 1

Start 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.