Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Prettier SvgNew to Visual Studio Code? Get it now.
Prettier Svg

Prettier Svg

Ann

|
250 installs
| (0) | Free
prettier and compress svg
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

beautify svg

中文版

Overview

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

  1. Open Visual Studio Code.
  2. 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.
  3. Search for "prettier svg".
  4. Click Install to install the extension.

Usage

Via Command Palette

  1. Select the svg code you want to convert.
  2. Open the Command Palette by pressing Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS).
  3. Type Prettier Svg and select the command.
  4. The selected svg code will be beautified.

Via Context Menu

  1. Select the svg code you want to convert.
  2. Right-click in the active editor to open the context menu.
  3. Select Prettier Svg.
  4. The selected svg code will be beautified.

Via Keyboard Shortcut

  1. Select the svg code you want to convert.
  2. Press the following keyboard shortcut:
    • Windows/Linux: Ctrl+Alt+G
    • macOS: Cmd+Alt+G
  3. 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 属性,将它们压缩成一行,并在外层添加父级样式属性。

功能

  • 删除无用属性。
  • 继承父级样式。
  • 删除空格并压缩为一行代码。
  • 支持通过命令面板、上下文菜单和键盘快捷键转换 svg 代码。
  • 无需额外配置。
  • MIT 许可证。
  • 支持中文。

安装

  1. 打开 Visual Studio Code。
  2. 通过单击窗口侧边的活动栏中的扩展图标或按 Ctrl+Shift+X 打开扩展视图。
  3. 搜索 "prettier svg"。
  4. 单击 安装 安装扩展。

使用

通过命令面板

  1. 选择要转换的 svg 代码。
  2. 按 Ctrl+Shift+P(Windows/Linux)或 Cmd+Shift+P(macOS)打开命令面板。
  3. 输入 Prettier Svg 并选择命令。
  4. 选定的 svg 代码将被美化。

通过上下文菜单

  1. 选择要转换的 svg 代码。
  2. 在活动编辑器中右键单击以打开上下文菜单。
  3. 选择 Prettier Svg。
  4. 选定的 svg 代码将被美化。

通过键盘快捷键

  1. 选择要转换的 svg 代码。
  2. 按以下键盘快捷键:
    • Windows/Linux:Ctrl+Alt+G
    • macOS:Cmd+Alt+G
  3. 选定的 svg 代码将被美化。

配置

不需要额外的配置。该扩展可以直接使用。

贡献

如果你有任何建议、错误报告或贡献,请随时在 GitHub 仓库

许可证

本项目基于 MIT 许可证。有关详细信息,请参阅 LICENSE文件

发行说明

0.0.5

  • Prettier SVG 的首个版本。
  • 通过删除不需要的属性、将它们压缩为一行并在外层添加父级样式属性来美化 SVG 代码。
  • 支持通过命令面板、上下文菜单和键盘快捷键转换 svg 代码。
  • 无需额外配置。
  • MIT 许可证。
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft