Format the text covered by the motion and keep cursor
gw{motion}
Example
Normal 0 / 2Operator pending 1 / 2Normal 2 / 2one two three four five six seven eight nine tenCursor on line 1, column 1one two three four five six seven eight nine tenCursor on line 1, column 1one two three four five
six seven eight nine tenCursor on line 1, column 1Format the text covered by the motion and keep cursor.
Waiting for motion or text object
Format the text covered by the motion and keep cursor
Before & after
one two three four five six seven eight nine tenCursor on line 1, column 1one two three four five
six seven eight nine tenCursor on line 1, column 1Start 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.