12

In Visual Studio Code, when you press ALT SHIFT F to format HTML document, VS Code would wrap a line that is too long into multiple lines.

I think VS Code let the line grow too long before wrapping. Is there a setting in VS Code to tell it to wrap after certain line length?

This question is NOT a duplicate of the hard wrap question. This is about wrapping during format document process.

Endy Tjahjono
  • 23,432
  • 23
  • 79
  • 119

2 Answers2

16

Open user settings: File - Preferences - Settings

Then add/edit this item:

"html.format.wrapLineLength": 80

FYI the new settings are in effect after you save the changes.

Endy Tjahjono
  • 23,432
  • 23
  • 79
  • 119
10

If you are formatting HTML and are annoyed that VScode formats your long lines into multiple lines, go to:

File > Preferences > Settings

Search for:

HTML › Format: Wrap Line Length

and set it to 0