From 1b08590da6b189851aa5ee1caec18c9a292bad9a Mon Sep 17 00:00:00 2001 From: lemyx Date: Tue, 21 Jan 2025 07:55:28 +0800 Subject: [PATCH] Enhance emacs-rime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 使用 rime-ice 和 wanxiang-lts-zh-hans.gram 2. 使用 switchkey 在 macOS 系统层面自动切换输入法 --- install/install-macos.sh | 18 ++++++++++++++++++ lisp/init-rime.el | 5 +++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/install/install-macos.sh b/install/install-macos.sh index 3c6730f..b6c1132 100644 --- a/install/install-macos.sh +++ b/install/install-macos.sh @@ -39,6 +39,24 @@ brew install aider # rime brew install --cask squirrel brew install librime +git clone https://github.com/iDvel/rime-ice.git && cd rime-ice +sed -i '' 's/page_size: 5/page_size: 9/' default.yaml +wget https://github.com/amzxyz/RIME-LMDG/releases/download/LTS/wanxiang-lts-zh-hans.gram +cat < rime_ice.custom.yaml +patch: + grammar: + language: wanxiang-lts-zh-hans.gram + collocation_max_length: 5 + collocation_min_length: 2 + translator/contextual_suggestions: true + translator/max_homophones: 7 + translator/max_homographs: 7 +EOL +cd .. +cp -r ./rime-ice/* ~/.config/fcitx/rime/ +cp -r ./rime-ice/* ~/Library/Rime +rm -rf rime-ice +brew install --cask switchkey # pomodoro brew install terminal-notifier diff --git a/lisp/init-rime.el b/lisp/init-rime.el index 8311b83..1eae096 100644 --- a/lisp/init-rime.el +++ b/lisp/init-rime.el @@ -9,8 +9,9 @@ (setq default-input-method "rime") (setq rime-user-data-dir "~/.config/fcitx/rime") (setq rime-show-candidate 'posframe) - :bind - ("C-SPC" . 'toggle-input-method) + (when (eq system-type 'darwin) + (setq rime-emacs-module-header-root "/opt/homebrew/include") + (setq rime-librime-root "/opt/homebrew/opt/librime")) ) (provide 'init-rime)