Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable HTML attribute alignment in Visual Studio Code

VS Code is stacking element attributes when I format HTML files. Is there any way to disable this?

like image 860
Joseph Freeman Avatar asked Feb 07 '17 20:02

Joseph Freeman


2 Answers

The default setting for this is:

"html.format.wrapAttributes": "auto"

With "auto" meaning:

Wrap attributes only when line length is exceeded.

The line length is defined in a different setting and defaults to 120:

// Maximum amount of characters per line (0 = disable).
"html.format.wrapLineLength": 120

So setting "html.format.wrapLineLength" to 0 should give you the desired behavior.

like image 186
Gama11 Avatar answered Oct 10 '22 04:10

Gama11


This worked for me. In your "Settings.json" file add the line

"prettier.printWidth": 300
like image 5
Ildefonso Muro Avatar answered Oct 10 '22 05:10

Ildefonso Muro