45

GitHub - DogLooksGood/emacs-rime: RIME ㄓ in Emacs

 4 years ago
source link: https://github.com/DogLooksGood/emacs-rime
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.org

Emacs Rime

https://i.imgur.com/RqJkzlx.gif

在 Emacs 中通过 liberime 集成 RIME 输入法,可支持多种输入方案。

使用方法

(use-package liberime-config
  :quelpa (liberime-config
           :fetcher github
           :repo "DogLooksGood/liberime"
           :files ("CMakeLists.txt" "Makefile" "src" "liberime-config.el")))

(use-package rime
  :quelpa (rime
           :fetcher github
           :repo "DogLooksGood/emacs-rime"
           :files ("rime.el")))

设置输入中发送到 Rime 的组合键。

下面的设置,使输入过程中的 C-fC-b 发送给 Rime 。可以用来配合方案中的设置完成光标移动和选字等功能。 支持 Control (C-), Meta (M-), Shift (S-)的组合键。

;; 默认值
(setq rime-translate-keybindings
  '("C-f" "C-b"))

候选框展示风格

设置 rime-show-candidate

可选值说明nil不展示minibuffer在minibuffer中展示, 推荐使用的方式message直接使用 message 输出,兼容控制 minibuffer 内容的插件popup使用 popup.el 展示跟随的候选

针对仓颉等具有编码注释功能的方案

目前的编码编辑功能与方案的编码注释不兼容,关闭方案中的编码注释或使用下面的设置关闭编码编辑功能。

(setq rime-input-editable nil)

用于展示的提示符

使用函数 (rime-lighter) 返回一个用于展示的 符号。 可以通过 rime-indicator-facerime-indicator-dim-face 设置样式。

临时英文模式的切换

如果使用模式编辑,或是需要在一些特定的场景下自动使用英文,可以 rime-disable-predicates

一个在 evil-normal-state 中、在英文字母后面以及代码中自动使用英文的例子。

(setq rime-disable-predicates
      '(evil-normal-state-p
        rime--after-alphabet-char-p
        rime--prog-in-code-p))

如果你使用 Linux

Emacs 有一个优秀的远古BUG: 如果 LC_CTYPEen_US.UTF8 的话,那么就无法调用起 Fcitx. 所以可以利用这点把 Emacs 内切换输入法的快捷键和系统快捷键设为同一个键。

优秀的 Emacs 输入法

你可能需要 pyim, liberime, erime.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK