Rus
Rus

Reputation: 790

XML autoformat in Visual Studio Code

Is there a way to make Visual Studio Code automatically format the content of XML tags?

I want to have an indent when pressing Enter or even when closing a tag:

Not as

The wrong way

but this way:

The right way

Upvotes: 20

Views: 60014

Answers (1)

Fred Bricon
Fred Bricon

Reputation: 5579

The XML extension, from Red Hat, supports auto-indentation on enter, among many useful other features (like validation, code completion, autoclose tag...):

auto-indent-on-enter

Upvotes: 27

Related Questions