Format the selected lines
gq
Example
Visual line 0 / 1Normal 1 / 1one two three four five six seven eight nine tenCursor on line 1, column 1 · Line selectionone two three four five
six seven eight nine tenCursor on line 2, column 1Format the selected lines.
Format the selected lines
Before & after
one two three four five six seven eight nine tenCursor on line 1, column 1 · Line selectionone two three four five
six seven eight nine tenCursor on line 2, column 1Start in Visual line mode. The highlighted area is observed in Vim. Any displayed register boxes show the exact copied or deleted contents.
Details & Vim help
Example replayed in Vim
Format the selected lines. Use in Visual mode. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.