You can set the width of a file, git commit message or any group of text by following these steps:
- Set text width with
:set tw=80(80 here stands for 80 columns)
- Select the text that you want to modify:
Vto enter visual mode.
- Format the width:
And that’s it!
twis short for
textwidthwhich you can also use (e.g.
- If you want to format text from the start of the cursor to the end of the file, use
gqGin Step 3