How do I reformat a paragraph to fit a specific line width in Vim?
gqap
The gq operator reformats text by wrapping lines to fit within the textwidth setting.
8 results for "gqap"
gqap
The gq operator reformats text by wrapping lines to fit within the textwidth setting.
gq{motion}
The gq{motion} operator reformats text to fit within Vim's textwidth setting, inserting hard line breaks where lines are too long.
gq
The gq operator reformats text to fit within your configured textwidth.
( / ) / { / }
Vim treats sentences and paragraphs as first-class navigation units.
navigation #navigation #motions #text-objects #prose #editing
:g/./,/^$/join
Hard-wrapped text (where each sentence is on its own line) is common in commit messages, email threads, and older documentation.
gqip
The gqip command reformats the current paragraph to fit within the configured textwidth.
gwap
The gw operator reformats text to fit within 'textwidth' — identical in effect to gq, but with one key difference: the cursor returns to its original position
dap / dip
The dap and dip commands use Vim's paragraph text objects to delete an entire block of contiguous text in a single motion.
editing #editing #text-objects #normal-mode #delete #motions