Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Auto Transform PunctuationNew to Visual Studio Code? Get it now.
Auto Transform Punctuation

Auto Transform Punctuation

alwaysingle

|
12 installs
| (0) | Free
自动切换和转换中英文标点符号
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Auto Transform Punctuation

一个 VSCode 插件,用于自动切换和转换中英文标点符号。在中文输入状态下,智能检测并转换中文标点符号为对应的英文标点符号。 0.0.4 和之前的版本有粘贴 bug,请使用 0.0.5 之后版本。 粘贴管理功能占时禁用,复制单个中文标题再粘贴目前会同时生成 2 个符合,优化中。

功能

  • 自动检测并转换中文标点符号为对应的英文标点符号
  • 支持自定义标点符号对照表
  • 支持的转换对照表:
{
    "。": ".",
    ",": ",",
    ":": ":",
    ";": ";",
    "!": "!",
    "“": "\"\"",
    "”": "\"\"",
    "‘": "''",
    "’": "''",
    "(": "()",
    ")": "()",
    "【": "[]",
    "】": "[]",
    "》": ">",
    "《": "<",
    "……": "^",
    "¥": "$",
    "、": "/",
    "?": "?",
    "·": "``"
};

智能检测规则

  1. 在注释中不做处理
  2. 前一个字符是中文时不处理
  3. 在字符串中时不做处理

使用方法

  1. 安装插件后,默认启用自动转换功能
  2. 可以通过命令面板(Ctrl+Shift+P)搜索"Toggle Auto Transform Punctuation"来启用/禁用功能
  3. 也可以在设置中配置相关选项

配置选项

  • autoTransformPunctuation.enabled: 是否启用自动转换标点符号(默认:true)
  • autoTransformPunctuation.dontHandlerTimeSpan: 禁用处理的时间间隔(毫秒),在执行撤销或重做操作后,此时间内不处理输入(默认:300)
  • autoTransformPunctuation.customPunctuationMap: 自定义标点符号对照表,用于覆盖默认的转换规则(默认:{})

自定义对照表示例

在 VSCode 设置中添加以下配置来覆盖默认的转换规则:

{
    "autoTransformPunctuation.customPunctuationMap": {
        "。": "..",
        ",": ",,",
        ":": "::"
    }
}

许可证

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft