Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to format svg and xml like html in vscode?

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.

like image 375
haki Avatar asked Jan 10 '19 10:01

haki


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)

like image 127
syntaqx Avatar answered Oct 06 '22 19:10

syntaqx