最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to disable svg preview in VS Code 1.97+ - Stack Overflow

programmeradmin3浏览0评论

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
Add a comment  | 

3 Answers 3

Reset to default 56

It'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.

  1. Right-click on the file in the Explorer and choose Open With... and then select the Text Editor option and you should get the svg code.

  2. 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.

发布评论

评论列表(0)

  1. 暂无评论