English | 简体中文
VS Code extension for formatting Rime dictionary files (*.dict.yaml
) and custom phrases (custom_phrase.txt
).
- Install the extension Rime formatter: https://marketplace.visualstudio.com/items?itemName=lxl66566.rime-formatter.
- Enable the plugin
"[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" // Sorting method, default is "spell", accepts "spell" | "weight" | null
}
This sorting method only applies to dictionaries; the custom_phrase
file is not affected by this setting.
You can view the formatting effects of the formatter in the tests directory.
- During the formatting process, only the first occurrence of a comment block will be retained. Subsequent comment blocks will be lost.
- The Rime dictionary must be in the following format:
columns: - text # vocabulary - code # encoding - weight # weight, which can be omitted
- Columns in the dictionary and word library can be separated by spaces, and they will automatically be converted to tab-separated after formatting.
- You can view supported dictionary samples in the tests directory.