Vim Recall繁體中文

Format the text covered by the motion and keep cursor

gw{motion}

Example

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

Format the text covered by the motion and keep cursor.

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 1, column 1

Start in Normal mode. Use ap for {motion}; textwidth=24 and formatoptions=tcq.

Details & Vim help

Example replayed in Vim

Format the text covered by the motion and keep cursor. Use in Normal mode. Braced names stand for the required argument and are not typed literally. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.