This extension allows you to beautify SVG code in Visual Studio Code.
Remove unwanted svg attributes, compress them into a single line, and add superficially parent style attributes to the outer layer.
Features
Delete useless attribute.
Inherits the parent style.
Remove Spaces and compress to a single line of code.
Installation
Open Visual Studio Code.
Go to the Extensions view by clicking the Extensions icon in the Activity Bar on the side of the window or by pressing Ctrl+Shift+X.
Search for "prettier svg".
Click Install to install the extension.
Usage
Via Command Palette
Select the svg code you want to convert.
Open the Command Palette by pressing Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS).
Type Prettier Svg and select the command.
The selected svg code will be beautified.
Via Context Menu
Select the svg code you want to convert.
Right-click in the active editor to open the context menu.
Select Prettier Svg.
The selected svg code will be beautified.
Via Keyboard Shortcut
Select the svg code you want to convert.
Press the following keyboard shortcut:
Windows/Linux: Ctrl+Alt+G
macOS: Cmd+Alt+G
The selected svg code will be beautified.
Configuration
No additional configuration is required. The extension is ready to use out of the box.
Contributing
If you have any suggestions, bug reports, or contributions, feel free to open an issue or submit a pull request on the GitHub repository.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Release Notes
0.0.5
Initial release of Prettier SVG.
Beautify SVG code by removing unwanted attributes, compressing them into a single line, and adding superficially parent style attributes to the outer layer.
Support for converting svg code via the Command Palette, Context Menu, and Keyboard Shortcut.
No additional configuration required.
MIT License.
中文版
这个扩展允许你在 Visual Studio Code 中美化 SVG 代码。
删除不需要的 svg 属性,将它们压缩成一行,并在外层添加父级样式属性。