Double Pinyin rime and emacs-rime on Debian 10

Full setup of rime and emacs-rime with double-pinyin schema on Debian 10.

Install rime and double-pinyin (Debian 10)

sudo apt-get install fcitx fcitx-rime
sudo apt-get install librime-bin librime-dev librime1 librime-data-double-pinyin

Reboot, fcitx should be started automatically after login (if not, manually run fcitx from a terminal).

Configure rime

  • Right click the fcitx icon → Configure → Add Input Method (+)
  • Tick off “Only Show Current Language”
  • Type in “Rime” in “Search Input Method” → Click “OK”

But somehow adding double pinyin schema via the GUI doesn’t work.

So manually create ~/.config/fcitx/rime/default.custom.yaml:

patch:
  schema_list:
    - schema: double_pinyin_mspy

Simplified Hanzi

However, I can only type traditional Chinese characters with the above setup.

Following rime’s wiki page, edit the corresponding double pinyin schema file: /usr/share/rime-data/double_pinyin_mspy.schema.yaml:

  • rename “simplification” to “zh_simp” and add “reset: 1” under it.
    from:

    switches:
      - name: ascii_mode
        reset: 0
        states: [ 中文, 西文 ]
      - name: full_shape
        states: [ 半角, 全角 ]
      - name: simplification
        states: [ 漢字, 汉字 ]
      - name: ascii_punct
        states: [ 。,, ., ]
    

    to:

    switches:
      - name: ascii_mode
        reset: 0
        states: [ 中文, 西文 ]
      - name: full_shape
        states: [ 半角, 全角 ]
      - name: zh_simp
        reset: 1
        states: [ 漢字, 汉字 ]
      - name: ascii_punct
        states: [ 。,, ., ]
    
  • add simplifier filter at the end of the schema file:

    simplifier:
      option_name: zh_simp
    

emacs-rime

Install emacs-rime: M-x package-install rime

Then add basic configuration in .emacs:

ordinary:

(require 'rime)
(setq default-input-method "rime")

use-package:

(use-package rime
  :ensure t
  :config
  (setq default-input-method "rime")
  )

Note then you’ll need to copy ~/.config/fcitx/rime/default.custom.yaml to ~/.emacs.d/rime/ otherwise there’ll be conflicts (see https://github.com/DogLooksGood/emacs-rime/issues/107).

DONE!