Configuring Rime Input Method on macOS

Installing Rime

Recently, I learned from Teacher fernvenue how to configure input methods on Debian GNOME and found that Rime is also applicable on macOS. Configuring Rime/Zhongzhouyun on macOS is just as straightforward.

Firstly, visit the Rime official website and directly download the installation package for Squirrel.pkg. After installation, the package will prompt you to either log out and log back in or manually log out and log in again.

Then, navigate to System Preferences > Keyboard > Text Input > Edit, and search for “Chinese” to add “Squirrel” to text input. Now you can switch to Squirrel by switching input methods.

Downloading Dictionaries

The usability of an input method heavily relies on dictionaries. Here, I simply and directly added the dictionaries from Luna and Chinese Wikipedia, which should cover most of the input needs.

For the Luna dictionary, it can be found in this repository. Simply download luna_pinyin.dict.yaml. For zhwiki, I found an author who continuously updates its content, available here.

Download the latest update, for example: zhwiki-20240210.dict.yaml.

In macOS, Rime’s configuration path is generally at ~/Library/Rime/. You can also directly open the configuration folder by clicking “User Settings…”. Place luna_pinyin.dict.yaml and zhwiki.dict.yaml into this folder.

Configuring Dictionaries

Furthermore, to add multiple dictionaries simultaneously, you need to configure specific schemas.

Simply add a default.custom.yaml.

1
2
3
4
5
fallback
~$ cat ./default.custom.yaml 
patch:
  schema_list:
    - {schema: luna_pinyin}

Taking luna_pinyin as an example, create a customized user configuration that applies to luna_pinyin.

1
2
3
$ cat ./luna_pinyin.custom.yaml 
patch:
  translator/dictionary: personal

Create personal.dict.yaml for this configuration.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
fallback
$ cat ./personal.dict.yaml 
---
name: personal
version: "20240214"
sort: by_weight
use_preset_vocabulary: true
import_tables:
  - luna_pinyin
  - zhwiki
...

Now you should have these files in ~/Library/Rime/ or the user configuration folder.

1
2
3
4
$ ls ~/Library/Rime/
build	luna_pinyin.custom.yaml	personal.dict.yaml
default.custom.yaml	luna_pinyin.dict.yaml	zhwiki.dict.yaml user.yaml
installation.yaml	luna_pinyin.userdb 

Since we’ve already placed the luna and zhwiki dictionaries in the user configuration folder, clicking “Deploy” in the input method settings should make them effective immediately.

Switching Input Methods

You can switch input methods using F4, for example, switching between Simplified and Traditional Chinese input methods.