Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Rime formatterNew to Visual Studio Code? Get it now.
Rime formatter

Rime formatter

lxl66566

|
28 installs
| (0) | Free
VS Code extension for formatting Rime dictionary files and custom phrases
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Rime formatter

English | 简体中文

VS Code 插件,用于格式化 Rime 词库文件(*.dict.yaml)和自定义短语(custom_phrase.txt)。

使用方法

  1. 安装插件 Rime formatter:https://marketplace.visualstudio.com/items?itemName=lxl66566.rime-formatter。
  2. 启用插件
    "[dict-yaml]": {
      "editor.formatOnSave": true,
      "editor.defaultFormatter": "lxl66566.rime-formatter"
    },
    "[custom-phrase]": {
      "editor.formatOnSave": true,
      "editor.defaultFormatter": "lxl66566.rime-formatter"
    }
    

设置项

"rime-formatter": {
  "sort_by": "spell"  // 排序方式,默认为 spell,可选值为 "spell" | "weight" | null
}

此排序方式仅对 dict 生效,custom_phrase 文件不受此设置影响。

格式化效果

你可以在 tests 里查看 formatter 的格式化效果。

对词库文件的要求

  1. 格式化过程中只会保留第一次出现的注释块。后续的其他注释块会丢失。
  2. rime dict 必须是如下格式:
    columns:
      - text # 词汇
      - code # 编码
      - weight # 权重,可以不写
    
  3. 字典和词库中可以使用空格分割 columns,格式化后会自动转为 tab 分割
  4. 你可以在 tests 里查看支持的词库样例。
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft