Writing this here because I always forget about it:
Use gq
Two approaches I like:
- select the pagraph in visual line mode and type
gq
- use
gqip
whereip
stands for inner paragraph
Use the textwidth
/tw
config to set the length of a paragraph line:
:set tw=80
Source: https://vim.fandom.com/wiki/Automatic_formatting_of_paragraphs