screenshot showing a git commit message that i want to wrap

You can set the width of a file, git commit message or any group of text by following these steps:

  1. Set text width with :set tw=80 (80 here stands for 80 columns)
  2. Select the text that you want to modify: V to enter visual mode.
  3. Format the width: gq

And that’s it!

More information

  • tw is short for textwidth which you can also use (e.g. :set textwidth=80
  • If you want to format text from the start of the cursor to the end of the file, use gqG in Step 3

Source: vim command to restructure/force text to 80 columns