Vim Recall繁體中文

Reindent a paragraph

=ap

Example

Normal 0 / 2
  one
  two

keep
Cursor on line 1, column 4

Apply the indentation operator to a paragraph.

Before & after
Before
  one
  two

keep
Cursor on line 1, column 4
After
one
two

keep
Cursor on line 1, column 1

Start in Normal mode, at line 1, column 4 (one-based). Use shiftwidth=2, expandtab and no automatic indentation for this example. = follows the active indentation rules. An object can make an operator linewise. Press =ap.

Details & Vim help

Example replayed in Vim

Apply the indentation operator to a paragraph.

Use shiftwidth=2, expandtab and no automatic indentation for this example. = follows the active indentation rules. An object can make an operator linewise.