monjuri
monjuri

Reputation: 141

How can I put a HTML tag in one line in VS Code?

The VS Code in my Mac pc is automatically breaking the customer HTML tags in new lines. This is making the length of the whole code much bigger. For example, I want below code in one line

<FormInput name="propertyTax" width="43%" height="7%" placeholder="3,200"></FormInput>

But the VS code is showing as below.

<FormInput
name="propertyTax"
width="43%"
height="7%"
placeholder="3,200">
</FormInput>

I tried change wordwrap from settings with no luck.

Please help me.

Upvotes: 7

Views: 6371

Answers (3)

Sergey Sypalo
Sergey Sypalo

Reputation: 1339

Just press F1, and type: join lines

Upvotes: 6

Dmitriy Salynin
Dmitriy Salynin

Reputation: 11

If you're using Prettier formatter. Go to Settings and search for this: prettier.printWidth and change from default 80 to 300.

Upvotes: 1

Vincent Ramdhanie
Vincent Ramdhanie

Reputation: 103135

You can try switching off any formatters that you have in VSCOde. Go to Code > Preferences > Settings and search for "Format" and try switching off "Format on Save" and any other format option that you have.

Upvotes: 1

Related Questions