Vim Recall繁體中文

Format the current line

gqq

Example

Normal 0 / 2
one two three four five six seven eight nine ten
Cursor on line 1, column 1

Use a repeated formatting operator for one line.

Before & after
Before
one two three four five six seven eight nine ten
Cursor on line 1, column 1
After
one two three four five
six seven eight nine ten
Cursor on line 2, column 1

Start in Normal mode, at line 1, column 1 (one-based). Set textwidth=24 and formatoptions=tcq. The q repeats the line-formatting operator. Press gqq.

Details & Vim help

Example replayed in Vim

Use a repeated formatting operator for one line.

Set textwidth=24 and formatoptions=tcq. The q repeats the line-formatting operator.