3 ways to open SVG files as text instead of preview mode in Visual Studio Code.
Method 1: Set editor via context menu
- Locate any
.svg
file - Right-click it and select Open With...
- Select Configure default editor for '*.svg'...
- Set **Text Editor" as the default
Method 2: Set editor via settings.json
- Open Manage menu from the gear icon (⚙️)
- Go to Settings
- Open
settings.json
from the file icon (📃) - Add the following snippet:
"workbench.editorAssociations": {
"*.svg": "default"
}
Method 3: Set editor via GUI
- Open Manage from the gear icon (⚙️)
- Go to Settings
- Search for
Workbench.EditorAssociation
- Click Add Item
- Enter
*.svg
in the Item field - Enter
default
in the Value field - Click OK to apply
Contact & Links
Contact
- YouTube: @vrauuss-softwares
- GitHub: vrauuss-softwares
Blog
- Coming soon...
Articles
- YouTube: How to Disable SVG Preview Mode
- DEV.to: How to Disable SVG Preview Mode
References
- GitHub: SVG files open as Preview
- Stack Overflow: Unable to import SVG with Vite as React Component
Top comments (1)
Don't forget to subscribe and leave a like to support!