XiaO

更新 Rime 配置

XiaO / 2020-05-18


现在越来越觉得,好像做什么事情都需要理由。那好吧,使用 Rime 的理由如下:

惯用小鹤双拼 + 系统英文输入法

安装

brew install --cask squirrel

Rime 配置文件 说明 1 说明 2

配置文件采用 UTF-8 编码,格式为 YAML 文本。Mac 下文件夹所在地址:~/Library/Rime/,其中文件结构如下:

├── default.custom.yaml # 全局配置
├── squirrel.custom.yaml # 外观定制

├── custom_phrase.txt # 个人短语定制

├── double_pinyin_flypy.schema.yaml # <方案标识>.schema.yaml - 预设输入方案
├── double_pinyin_flypy.custom.yaml # <方案标识>.custom.yaml - 用户对预设输入方案的定制信息

# <词库名>.dict.yaml - 词库
├── luna_pinyin.dict.yaml # 主词库
├── luna_pinyin.extended.dict.yaml # 副词库 -
├── luna_pinyin.cn_en.dict.yaml # 副词库 - 中英文混合短语
├── luna_pinyin.hanyu.dict.yaml # 副词库 - 汉语大词典
├── luna_pinyin.poetry.dict.yaml # 副词库 - 唐诗宋词、千家集、楚辞、诗经
├── luna_pinyin.sgmain.dict.yaml # 副词库 - 电脑软件分类、计算机术语、全国省地市区县地名、穴位、西药药名、经典小说、音乐专业词库、网络流行新词

├── installation.yaml # 安装信息
├── user.yaml # 用户状态信息
├── build # 部署输入方案时产生文件所在的文件夹

# <词库名>.userdb
└── luna_pinyin.userdb # 记录用户用字习惯中的文件夹(自动生成)

全局配置 (default.custom.yaml)

# default.custom.yaml, 全局生效
patch:
  schema_list:
    - schema: double_pinyin_flypy # 小鹤双拼
  switcher/hotkeys:
    - F4
  switcher/save_options:
    - full_shape
    - ascii_punct
    - simplification
    # - zh_hans
    # - emoji_suggestion
  menu/page_size: 5 # 定制每页候选数
  # 更改切换中西文的快捷键
  ascii_composer:
    good_old_caps_lock: true
    switch_key:
      Shift_L: noop # 关闭 Shift_L 的中英文切换。需开启输入方案中处理西文模式及中西文切换功能 - ascii_composer
      Caps_Lock: commit_code # 开启大写字母直接上屏。需开启输入方案中处理西文模式及中西文切换功能 - ascii_composer
      Shift_R: noop
      Control_L: noop
      Control_R: noop
      Eisu_toggle: clear

外观配置 (squirrel.custom.yaml )

patch:
  style:
    color_scheme: mojave_dark

  preset_color_schemes:
    mojave_dark:
      name: "沙漠夜/Mojave Dark"
      author: "xiehuc <[email protected]>"
      alpha: 0.9
      horizontal: true # 候选窗横向显示
      inline_preedit: true
      candidate_format: "%c %@ "
      corner_radius: 5
      hilited_corner_radius: 0
      border_height: 6
      border_width: 12
      border_color_width: 0
      font_face: PingFangSC # 预选栏文字字体
      font_point: 16
      label_font_point: 12  #预选栏数字大小
      text_color: 0xffffff
      back_color: 0x1e1e1e
      label_color: 0x888785
      border_color: 0x717171
      candidate_text_color: 0xffffff
      hilited_text_color: 0xffffff
      hilited_back_color: 0x1e1e1e
      hilited_candidate_text_color: 0xffffff
      # hilited_candidate_back_color: 0xcb5d00
      hilited_candidate_label_color: 0x888785
      comment_text_color: 0xdedddd

  # app_options: {}
  "app_options/com.apple.Terminal": # 设置特定软件中默认西文输入
      ascii_mode: true

扩展词库

patch:
  translator/dictionary: luna_pinyin
# luna_pinyin.dict.yaml
---
name: luna_pinyin
version: "2020.05.18"
sort: by_weight
use_preset_vocabulary: true
# 如下为自己的词典引入明月拼音扩展词库
import_tables:
  - luna_pinyin.extended
  - luna_pinyin.hanyu
  - luna_pinyin.poetry
  - luna_pinyin.cn_en
  - luna_pinyin.sgmain
...
brew install opencc
opencc -h # 帮助信息

Rime 输入法 使 (xí) 用 (guàn) 说 (yǎng) 明 (chéng)

Rime 输入法备份

多台电脑及不同系统之间同步用户词典和用户设定的备份,可编辑用户文件夹下的 installation.yaml ,添加 sync_dir: '' 语句,并补充上相应的同步位置即可:

sync_dir: '/Users/xiao/RimeSync/'
installation_id: 'Rime-setting-mac-xiao'