How to format a paragraph/whole file in vim?
If you want to format a paragraph in vim, you should use the following:
gqap
If you want to format a whole file in vim, you should use the following:
gqG
For more details, use help fo where fo stands for format-options