How to format svg and xml like html in vscode?

Viewed 8495

When I open an svg or xml file and try to run "Format Document" I get the message:

There is no document formatter for 'xml'-files installed.

To overcome that I usually just do "Language Mode" -> select HTML -> "Format Document".

Is it possible to use the HTML formatter for XML and SVG?

P.S I rather not install extensions.

1 Answers

You should be able to override any extension to the language of your choice:

"files.associations": {
    "*.xml": "html",
    "*.svg": "html",
}

Chuck that in your settings.json and you should be golden (although, I recommend not doing this, but it's your life)

Related