17

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
  • 24,120
  • 23
  • 83
  • 123

2 Answers2

23

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
  • 24,120
  • 23
  • 83
  • 123
13

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

Dimitris Siakavelis
  • 1,048
  • 9
  • 10