Rime
Rime is an input method engine for entering Chinese characters, supporting a wide range of input methods.
The Rime engine itself does not provide a frontend for receiving user input. It must be used with an input method framework such as Fcitx5 or IBus.
Installation
Install the librime package containing the Rime engine, and the integration corresponding with your IMF:
- For Fcitx5, installfcitx5-rime.
- For Fcitx, install fcitx-rime.
- For IBus, install ibus-rime.
Configuration
In order for Rime to work, input schemas are needed. Schemas are text files that can be created and customized by users. Alternatively, there are several official input schemas available in package repository:
- rime-luna-pinyin - 朙月拼音 Standard Mandarin
- rime-terra-pinyin - 地球拼音 Mandarin with tones
- rime-double-pinyin - Double pinyin input schemas, include 自然碼雙拼, 智能ABC雙拼, 小鶴雙拼, MSPY雙拼 and 拼音加加雙拼.
- rime-pinyin-simp - 袖珍简化字拼音 Simplified pinyin
- rime-cantonese - 粵語拼音 Cantonese pingjam
- rime-cangjie - 倉頡五代 Cangjie
- rime-quick - 速成 Quick
- rime-stroke - 五筆畫 Stroke
- rime-wubi - 五筆字型86 Wubi
- rime-wugniu - 上海吳語 wugniu
- rime-bopomofo - 注音 bopomofo
- rime-emoji - Emoji input
By default, some schemas are installed with librime-data meta package as it is a dependency of librime.
Some schema packages provide more than one schemas. For example, rime-luna-pinyin provides 5 schemas including luna_pinyin
and luna_pinyin_fluency
. You can check content of each package from Rime GitHub organization.
You can switch input schema at any time by pressing F4
to trigger the program menu. See #Selecting Input Method.
To customize Rime, you should first create the Rime configuation directory. Assuming you are using ibus-rime:
$ mkdir ~/.config/ibus/rime
Or if you are using fcitx-rime:
$ mkdir ~/.config/fcitx/rime/
Or if you are using Fcitx5:
$ mkdir ~/.local/share/fcitx5/rime/
In this directory, create a file named default.custom.yaml
, where you specify your input schema of choice. For example, if you want to be able to type pinyin with tones, you can use the Terra Pinyin input method by adding it to the list of enabled schemas:
default.custom.yaml
patch: schema_list: - schema: terra_pinyin
Note that the indentation level is important. This file overrides the default configuration, so if you only add Terra Pinyin, it will be the only schema enabled.
To make the customizations effective, you need to redeploy. If you have working IBus or Fcitx GUI, you may find a ⟲ (Deploy) button and click it. Alternatively, use the following command, assuming you are using ibus-rime:
$ rm ~/.config/ibus/rime/default.yaml && ibus-daemon -drx
Or if you are using fcitx-rime:
$ rm ~/.config/fcitx/rime/default.yaml && fcitx-remote -r
Or if you are using fcitx5-rime:
$ rm ~/.local/share/fcitx5/rime/default.yaml $ fcitx5-remote -r
Specifying tones is optional but they are very useful for filtering the list:
1st tone: - 2nd tone: / 3rd tone: < 4th tone: \
For example, if one wants to type hǎo
to display only Chinese characters that are pronounced this way, one must type hao<
and it will be automatically converted to "hǎo".
By default, RIME only displays five candidates for input whilst typing. You can change this by setting the "menu/page_size"
value manually.
default.custom.yaml
patch: "menu/page_size": 9
Usage
Selecting Input Method
By default, while running Rime, you can access some basic options with F4
or Ctrl+`
. The displayed options look like this:
1. Method name 2. 中文 -› 西文 3. 全角 -› 半角 4. 漢字 -› 汉字 etc.
The first one indicates the name of the method you have selected (Ex: 地球拼音 for Terra Pinyin). If you have enabled multiple input methods, you can switch between them.
The second one lets you switch between Chinese and western languages.
The third one lets you select if you want to type the punctuation in full width (全角) or in half width (半角).
The last one allows you to switch between traditional Chinese (漢字) and simplified Chinese (汉字).
Chinese punctuation
Chinese punctuation is typed like so:
[ -> 「 【 〔 [ ] -> 」 】 〕 ] { -> 『 〖 { } -> 』 〗 } < -> 《 〈 « ‹ > -> 》 〉 » › @ -> @ @ ☯ / -> / / ÷ * -> * * ・ × ※ % -> % % ° ℃ $ -> ¥ $ € £ ¥ | -> ・ | | § ¦ _ -> —— \ -> 、 \ \ ^ -> …… ~ -> 〜 ~ ~ 〰
Advanced
More advanced examples are provided on the project website (in Chinese).
Troubleshooting
ibus-setup set orientation invaild in GNOME environment
See issue #52. Create ~/.config/ibus/rime/build/ibus_rime.yaml
with follows:
style: horizontal: true
Tips and tricks
Greek letters
Greek characters can be typed by adding the following to luna_pinyin.custom.yaml
or a custom input scheme file:
luna_pinyin.custom.yaml
recognizer: patterns: # Use / as the identifier here # You can freely replace your favorite identifiers (such as: `~, .\; etc., characters that need not be displayed directly on the screen) # Replace the / before the Greek letter at the same time punct: "^/([0-9]0?|[A-Za-z]+)$" punctuator: symbols: # Here, the letter name is used as the code of the Greek letter, and you can replace it with your favorite code as needed. # For example, if you want to use a as the alpha code # just replace the alpha below with a "/alpha": ["Α", "α"] "/beta": ["Β", "β"] "/gamma": ["Γ", "γ"] "/delta": ["Δ", "δ"] "/epsilon": ["Ε", "ε"] "/zeta": ["Ζ", "ζ"] "/eta": ["Η", "η"] "/theta": ["Θ", "θ"] "/iota": ["Ι", "ι"] "/kappa": ["Κ", "κ"] "/lambda": ["Λ", "λ"] "/mu": ["Μ", "μ"] "/nu": ["Ν", "ν"] "/xi": ["Ξ", "ξ"] "/omicron": ["Ο", "ο"] "/pi": ["Π", "π"] "/rho": ["Ρ","ρ"] "/sigma": ["Σ", "σ", "ς"] "/tau": ["Τ", "τ"] "/upsilon": ["Υ", "υ"] "/phi": ["Φ", "φ"] "/chi": ["Χ", "χ"] "/psi": ["Ψ", "ψ"] "/omega": ["Ω", "ω"]
For example, with this scheme, the character α
is produced by typing /alpha
.