This is the issue I am facing:
SVGs have begun to open as regular files, which I do not need, I would like to view them as HTML markup.
I do not know how this has happened. I haven't made any changes to my VS Code, I haven't installed any extensions recently and the day before yesterday this working was fine.
This is the issue I am facing:
SVGs have begun to open as regular files, which I do not need, I would like to view them as HTML markup.
I do not know how this has happened. I haven't made any changes to my VS Code, I haven't installed any extensions recently and the day before yesterday this working was fine.
Share Improve this question edited Mar 12 at 10:19 pjpscriv 1,2791 gold badge15 silver badges29 bronze badges asked Jan 16 at 23:28 user24302837user24302837 4013 silver badges3 bronze badges 1- hi, the question is good, you should accept a correct answer so that the community can use the solution given to you ... (nnatali worked for me) – webman Commented Feb 24 at 5:46
3 Answers
Reset to default 56It's a new feature for last version. I prefer to see the XML markup too.
I found your post looking for how to disable it, but I found the solution in another website.
Go to settings, search for workbench.editorAssociations and add item with key: *.svg and value: default
Screenshot:
VS Code was recently updated to render SVG files as previews by default.
Paste this in your settings.json
to disable the feature:
"workbench.editorAssociations": {
"*.svg": "default"
}
You must be using the Insiders Build as there was a recent commit that enabled previewing svg's just like other "images".
You can do one of two things.
Right-click on the file in the Explorer and choose
Open With...
and then select theText Editor
option and you should get the svg code.You can set the default to be to open svg files in a text editor instead of an image preview from that same context menu. Choose the
Configure default editor for *.svg files
and it will always open in a text editor thereafter.