For VS code users: how to force a line width

2025-11-03

I find using Github PRs a great way of reviewing writing as well as code. This usually leads to a conversation about forcing a character length instead of the visual line wrapping when using VS code. As I'm not a VS code user myself I am often not able to show students who to do this.

Here is how to do this:

Steps

  1. Install the Rewrap extension
  2. Open the Command Palette: Cmd/Ctrl + Shift + P
  3. Type Extensions: Install Extensions
  4. Search for β€œRewrap” by stkb and install it

  5. Set your preferred column width

  6. Open Settings (Cmd/Ctrl + ,)
  7. Search for: Rewrap: Column
  8. Set a value such as 80

  9. Use it manually

  10. Select the text (or place the cursor in a paragraph)
  11. Run the command: Rewrap: Rewrap Comment / Text at Column (default shortcut: Alt + Q)

  12. Optional: Auto-format on save

  13. Add this to your settings.json: json "[markdown]": { "editor.defaultFormatter": "stkb.rewrap", "editor.formatOnSave": true }
  14. Replace [markdown] with any other language block if needed, e.g. [plaintext]

Notes