Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code XML autoformat

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

like image 788
Rus Avatar asked Oct 21 '17 11:10

Rus


1 Answers

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

like image 131
Fred Bricon Avatar answered Sep 26 '22 02:09

Fred Bricon