{"id":13813462,"url":"https://github.com/DogLooksGood/emacs-rime","last_synced_at":"2025-05-15T00:33:22.671Z","repository":{"id":41966752,"uuid":"242996017","full_name":"DogLooksGood/emacs-rime","owner":"DogLooksGood","description":"RIME ㄓ in Emacs","archived":false,"fork":false,"pushed_at":"2024-11-02T13:02:30.000Z","size":308,"stargazers_count":478,"open_issues_count":28,"forks_count":68,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-11-02T14:17:20.361Z","etag":null,"topics":["emacs","input-method","rime"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DogLooksGood.png","metadata":{"files":{"readme":"README.org","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-25T12:36:49.000Z","updated_at":"2024-11-02T13:02:33.000Z","dependencies_parsed_at":"2024-06-19T16:03:15.888Z","dependency_job_id":"92440f34-9b84-4546-8833-7a7716faa25f","html_url":"https://github.com/DogLooksGood/emacs-rime","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DogLooksGood%2Femacs-rime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DogLooksGood%2Femacs-rime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DogLooksGood%2Femacs-rime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DogLooksGood%2Femacs-rime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DogLooksGood","download_url":"https://codeload.github.com/DogLooksGood/emacs-rime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225319231,"owners_count":17455731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emacs","input-method","rime"],"created_at":"2024-08-04T04:01:18.627Z","updated_at":"2024-11-19T08:30:39.118Z","avatar_url":"https://github.com/DogLooksGood.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"#+TITLE: Emacs Rime\n\n[[https://melpa.org/#/rime][file:https://melpa.org/packages/rime-badge.svg]] [[https://stable.melpa.org/#/rime][file:https://stable.melpa.org/packages/rime-badge.svg]]\n\n[[file:README_EN.org][Document in English]]\n\n[[file:https://i.imgur.com/jHpk7BT.gif]]\n\n* 一、基本安装与使用方法\n\n  见 [[file:INSTALLATION.org][基本安装与使用方法]]\n\n* 二、Rime：方案配置与词库\n#+html: \u003cdetails\u003e\n#+html: \u003csummary\u003e切换折叠\u003c/summary\u003e\n** 设置输入中发送到 Rime 的组合键\n通过变量 ~rime-translate-keybindings~ 可以设置哪些组合键将发送至 Rime 。可以用来配合方案中的设置完成光标移动和选字等功能。\n支持 Control (C-), Meta (M-), Shift (S-)的组合键。\n\n#+BEGIN_SRC emacs-lisp\n  ;; 默认值\n  (setq rime-translate-keybindings\n    '(\"C-f\" \"C-b\" \"C-n\" \"C-p\" \"C-g\" \"\u003cleft\u003e\" \"\u003cright\u003e\" \"\u003cup\u003e\" \"\u003cdown\u003e\" \"\u003cprior\u003e\" \"\u003cnext\u003e\" \"\u003cdelete\u003e\"))\n#+END_SRC\n\n** 指定 Rime 共享目录和用户目录\n\n共享目录即 ~rime-share-data-dir~ 是 Rime 安装后放置配置（包括输入方案）的目录，\n例如 Linux 上默认为 =/usr/share/rime-data= ，通常使用默认值即可。\n如果使用其它的位置，可以配置该值。\n例如对于 fcitx5-rime 可能要使用 =~/.local/share/fcitx5/rime= 。\n\n用户目录即 ~rime-user-data-dir~ 为 emacs-rime 布署的位置（包括词频等）。\n默认为 =~/.emacs.d/rime= ，如果需要其它位置，可以配置该值。\n\n*不建议 ~emacs-rime~ 与 ~fcitx-rime~ 共用用户数据目录* 。\n以地球拼音方案在 fcitx-rime 与 emacs-rime 中使用为例，若设置\n#+BEGIN_SRC emacs-lisp\n(setq rime-user-data-dir \"~/.config/fcitx/rime/\")\n#+END_SRC\n，则在 ~emacs-rime~ 初次部署后，将会生成新的 ~terra_pinyin.userdb/~ 文件夹，原有 ~fcitx-rime~ 使用记录将会被移动到 ~terra_pinyin.userdb.old/~ ，此时新的 ~terra_pinyin.userdb.txt~ 中词频为空。\n\n** 打开 Rime 的配置文件\n\n使用 ~rime-open-configuration~ 打开自定义配置文件。\n\n使用 ~rime-open-schema~ 打开一个方案的自定义配置文件。\n\n** 重新部署\n#+html: \u003cdetails\u003e\n#+html: \u003csummary\u003e切换折叠\u003c/summary\u003e\n\n~emacs-rime~ 的配置文件更新之后，与 RIME 一样，都需要重新部署才可生效。\n\n以添加 ~地球拼音（terra_pinyin）~ 为例。\n\n找到 ~emacs-rime~ 配置所在路径，或使用 ~M-x rime-open-configuration~ 打开文件 ~default.custom.yaml~ ，在 ~patch:schema_list~ 中添加 ~- schema: terra_pinyin~ ，需要 ~M-x rime-deploy~ 重新部署才可启用地球拼音方案，重新部署成功后按 ~C-`~ 选择输入方案。\n\n示例如下：\n#+BEGIN_SRC yaml\npatch:\n  schema_list:\n    - schema: luna_pinyin\n    - schema: pinyin_simp\n    - schema: terra_pinyin\n  menu/page_size: 7 # 每页显示7个候选字词。\n  switcher:\n    hotkeys:\n      - Control+grave # 激活RIME选单的快捷键，某些版本的RIME支持\u003cF4\u003e为快捷键，容易与其他软件冲突。\n#+END_SRC\n\n*** 重新部署后原有个人词库丢失？\n\n这很可能是 ~emacs-rime~ 与 ~fcitx-rime~ 共用用户数据文件夹导致的。\n\n如何找回：（依然以地球拼音为例）设置 ~emacs-rime~ 用户数据目录到其他文件夹，删除 ~terra_pinyin.userdb/~ 并将 ~terra_pinyin.userdb.old/~ 重命名为前者，再次同步或部署， ~terra_pinyin.userdb.txt~ 亦将恢复。\n\n#+html: \u003c/details\u003e\n** 同步词库\n#+html: \u003cdetails\u003e\n#+html: \u003csummary\u003e切换折叠\u003c/summary\u003e\n\n~M-x rime-sync~ 可对 RIME 输入方案和词库进行同步与备份，每次同步双向进行，词库生成的备份文件为 ~sync/ins_id/schema.userdb.txt~ ，其本身是文件夹 ~schema.userdb/~ 中词库与词频使用记录的纯文本形式，方便用户跨平台、多设备使用。\n\n所谓双向同步，即当前设备中的词频或用户自造词（ ~schema.userdb/~ 中）与备份文件（ ~sync/ins_id/schema.userdb.txt~ 中）所记录的词库会被 RIME 合并，其 *并集* 将会继续记录在 ~schema.userdb/~ 中，同时生成一份新的备份文件，仍名为 ~sync/ins_id/schema.userdb.txt~ ，并（在不询问用户的情况下）将旧的覆盖。\n\n上述路径中 ~sync~ 文件夹与配置文件 ~default.custom.yaml~ 在同一目录， ~ins_id~ 对应的是 ~installation.yaml~ 文件中 ~installation_id~ 的值，默认值为随机生成，可自定义为其他字符串。\n\n以添加 ~地球拼音（terra_pinyin）~ 后同步为例。启用该方案后，在 RIME 数据目录下会产生名为 ~terra_pinyin.userdb~ 的文件夹，其中为使用频率与自造词的记录，不可随意修改。同步前先修改 ~installation.yaml~ 中内容为自定义的 ~installation_id: \"hesperus\"~ ，之后 ~M-x rime-sync~ ，将会在 ~sync/hesperus/~ 生成文件 ~terra_pinyin.userdb.txt~ （词库）与 ~terra_pinyin.schema.yaml~ （输入方案）。\n\n若在其他设备或系统中有个人积累的词库，想继续使用。则先在旧系统中进行同步，将生成的 ~terra_pinyin.userdb.txt~ 复制到当前系统的 ~sync/hesperus/~ 下，再进行同步或部署，此时旧系统中备份的词库将会被合并到当前系统的 ~terra_pinyin.userdb/~ ，新的并集也将会被同时导出，并覆盖 ~terra_pinyin.userdb.txt~ 。\n\n#+html: \u003c/details\u003e\n*** 词库同步失败？\n#+html: \u003cdetails\u003e\n#+html: \u003csummary\u003e切换折叠\u003c/summary\u003e\n\n（以地球拼音方案使用为例。）\n\n*建议将不同设备或系统中的 ~installation_id~ 设为同一值* 。若其不同，则可能同步失败，即从旧系统同步并复制的 ~terra_pinyin.userdb.txt~ 中的词频记录不会被纳入到当前的 ~terra_pinyin.userdb/~ 。\n此时该文件中词频不为空，但其中 ~user_id~ 等不同，修改此值后再次同步仍可能不生效。\n#+html: \u003c/details\u003e\n#+html: \u003c/details\u003e\n* 三、样式设置\n#+html: \u003cdetails\u003e\n#+html: \u003csummary\u003e切换折叠\u003c/summary\u003e\n** 候选框展示风格\n\n设置 ~rime-show-candidate~ 。\n\n| 可选值     | 说明                                                   |\n|------------+--------------------------------------------------------|\n| ~nil~        | 不展示                                                 |\n| ~minibuffer~ | 在 minibuffer 中展示， 推荐使用的方式                    |\n| ~message~    | 直接使用 ~message~ 输出，兼容控制 ~minibuffer~ 内容的插件  |\n| ~popup~      | 使用 ~popup.el~ 展示跟随的候选                           |\n| ~posframe~   | 使用 ~posframe~ 展示跟随的候选，在不可用的时候会用 ~popup~ |\n| ~sidewindow~ | 使用 ~sidewindow~ 展示跟随的候选                         |\n\n** 候选样式\n\n| Face                    | 说明                               |\n|-------------------------+------------------------------------|\n| ~rime-default-face~       | 默认的前景色和背景色（仅 posframe） |\n| ~rime-code-face~          | 编码的颜色                         |\n| ~rime-candidate-num-face~ | 候选序号颜色                       |\n| ~rime-comment-face~       | 编码提示颜色                       |\n\n** posframe/popup/sidewindow 候选版式\n\n设置 ~rime-posframe-style~ ， ~rime-popup-style~ 或者 ~rime-sidewindow-style~ 可选值有\n\n| 可选值     | 说明       |\n|------------+------------|\n| ~simple~     | 单行       |\n| ~horizontal~ | 水平，默认 |\n| ~vertical~   | 垂直       |\n\n** posframe 的其它属性\n\n设置 ~rime-posframe-properties~, 其中颜色的设置使用 ~rime-default-face~.\n\n#+begin_src emacs-lisp\n  (setq rime-posframe-properties\n   (list :font \"sarasa ui sc\"\n         :internal-border-width 10))\n#+end_src\n\n支持的内容参照 [[https://github.com/tumashu/posframe/blob/master/posframe.el#L212][posframe]] 。\n\n** sidewindow 的其它屬性\n\n设置 ~rime-sidewindow-style~ ，可选值有 ~top~, ~bottom~, ~left~, ~right~ ，分别指 sidewindow 出现的位置位于上下左右。\n\n设置 ~rime-sidewindow-keep-window~ ，为 ~t~ 时可保持 sidewindow 为开启状态。\n\n** 彩色指示标志\n\n可用 ~(rime-lighter)~ 得到彩色指示标志 ~ㄓ~.\n可将其放在 modeline 等任意地方。\n\n可用 ~rime-title~ 、 ~rime-indicator-face~ 和 ~rime-indicator-dim-face~ 来自定义。\n** 设置软光标的样式\n\n默认使用 ~|~ 字符做为软光标，可以通过如下方式修改。\n\n#+BEGIN_SRC emacs-lisp\n  (setq rime-cursor \"˰\")\n#+END_SRC\n\n颜色可通过 ~rime-cursor-face~ 设置。\n\n** 设置嵌入文本的样式\n\n可通过 ~rime-preedit-face~ 设置。\n\n** 编码的展示形式\n\n设置 ~rime-show-preedit~, 可选值有\n| 可选值 | 说明         |\n|--------+--------------|\n| ~t~      | 展示在菜单中 |\n| ~inline~ | 替换上屏预览 |\n| ~nil~    | 不展示       |\n\n注意：使用 ~inline~ 或 ~nil~ 将不再展示软光标。\n\n#+html: \u003c/details\u003e\n* 四、自动化设置\n#+html: \u003cdetails\u003e\n#+html: \u003csummary\u003e切换折叠\u003c/summary\u003e\n** 临时英文模式\n#+html: \u003cdetails\u003e\n#+html: \u003csummary\u003e切换折叠\u003c/summary\u003e\n如果使用模式编辑，或是在一些特定的场景下需要自动使用英文，可以设\n置~rime-disable-predicates~ ， ~rime-disable-predicates~ 的值是一个断言列表，\n当其中有任何一个断言的值 **不是** nil 时，会自动使用英文。\n\n一个在 ~evil-normal-state~ 中、在英文字母后面以及代码中自动使用英文的例子。\n\n#+BEGIN_SRC emacs-lisp\n  (setq rime-disable-predicates\n        '(rime-predicate-evil-mode-p\n          rime-predicate-after-alphabet-char-p\n          rime-predicate-prog-in-code-p))\n#+END_SRC\n*** 目前可用的断言函数\n#+html: \u003cdetails\u003e\n#+html: \u003csummary\u003e切换折叠\u003c/summary\u003e\n\n- ~rime-predicate-after-alphabet-char-p~\n\n  在英文字符串之后（必须为以字母开头的英文字符串）\n\n- ~rime-predicate-after-ascii-char-p~\n\n  任意英文字符后\n\n- ~rime-predicate-prog-in-code-p~\n\n  在 ~prog-mode~ 和 ~conf-mode~ 中除了注释和引号内字符串之外的区域\n\n- ~rime-predicate-in-code-string-p~\n\n  在代码的字符串中，不含注释的字符串。\n\n- ~rime-predicate-evil-mode-p~\n\n  在 ~evil-mode~ 的非编辑状态下\n\n- ~rime-predicate-ace-window-p~\n\n  激活 ~ace-window-mode~\n\n- ~rime-predicate-hydra-p~\n\n  如果激活了一个 ~hydra~ keymap\n\n- ~rime-predicate-current-input-punctuation-p~\n\n  当要输入的是符号时\n\n- ~rime-predicate-punctuation-after-space-cc-p~\n\n  当要在中文字符且有空格之后输入符号时\n\n- ~rime-predicate-punctuation-after-ascii-p~\n\n  当要在任意英文字符之后输入符号时\n\n- ~rime-predicate-punctuation-line-begin-p~\n\n  在行首要输入符号时\n\n- ~rime-predicate-space-after-ascii-p~\n\n  在任意英文字符且有空格之后\n\n- ~rime-predicate-space-after-cc-p~\n\n  在中文字符且有空格之后\n\n- ~rime-predicate-current-uppercase-letter-p~\n\n  将要输入的为大写字母时\n\n- ~rime-predicate-tex-math-or-command-p~\n\n  在 (La)TeX 数学环境中或者输入 (La)TeX 命令时\n\n#+html: \u003c/details\u003e\n*** 可提示临时英文状态的提示符\n\n使用函数 ~(rime-lighter)~ 返回一个用于展示的 ~ㄓ~ 符号。\n可以通过 ~rime-indicator-face~ 和 ~rime-indicator-dim-face~ 设置样式。\n\n如下设置可替换输入法的符号，使其用颜色提示当前的临时英文状态。\n\n#+begin_src emacs-lisp\n  ;;; 具体参考 mode-line-mule-info 默认值，其中可能有其它有用信息\n  (setq mode-line-mule-info '((:eval (rime-lighter))))\n#+end_src\n\n*** 基于 Rime inline ascii 模式的临时英文\n\n设置 ~rime-inline-predicates~ ，结构与 ~rime-disable-predicates~ 相同，具有较低优先级。\n\n这个功能主要用来实现输入带空格的临时英文的场景。\n\n由于当前实现限制，如果 Rime 配置中没有使用默认的 ~Shift_L~ 切换 inline ascii 模式，需要在 emacs-rime 中指定。\n两边配置相同才能正常激活。\n\n#+begin_src emacs-lisp\n  ;;; support shift-l, shift-r, control-l, control-r\n  (setq rime-inline-ascii-trigger 'shift-l)\n#+end_src\n\n在有编码的状态下使用 ~rime-inline-ascii~ 命令可以切换状态。\n\n#+begin_src emacs-lisp\n  (define-key rime-active-mode-map (kbd \"M-j\") 'rime-inline-ascii)\n#+end_src\n\n*** 临时英文中阻止标点直接上屏\n#+begin_src emacs-lisp\n  (setq rime-inline-ascii-holder ?x)      ; Any single character that not trigger auto commit\n#+end_src\n\n*** 断言成立时的强制中文模式\n使用 ~rime-force-enable~ 来临时强制使用强制中文模式（即无视 ~rime-disable-predicates~ 中的规则），\n在 *一次输入行为* 或 *取消输入* 之后会自动关闭强制中文模式。\n\n你可能需要给这个命令绑定一个按键来使用。\n\n#+begin_src emacs-lisp\n  (define-key rime-mode-map (kbd \"M-j\") 'rime-force-enable)\n#+end_src\n\n#+html: \u003c/details\u003e\n** Commit1 自动上屏\nemacs-rime 内置了 =rime-commit1= 函数，其作用是在输入状态下将候选框中的首项自动上屏。\n\n这对于不注重（或几乎不需要）选重、且码长可不固定（即简码）的输入方案，如纯形码、音形码等（尤其是顶功类方案）而言，非常有用。\n\n此函数不是针对单独使用的，而主要是为了配合自定义其它函数，以适应个人的各种使用场景。\n*** 实例：在切换输入法时首项自动上屏\n在切换输入法时首项自动上屏，这是 fcitx5-rime 等所支持的功能。\n这里就以在 emacs-rime 中实现相同功能为例，说明如何使用 =rime-commit1= 函数。\n\n基本思路是，先自定义一个函数，功能是先使得首项自动上屏，再切换输入法；\n再将这个函数绑定到某个按键组合上，来替代原本 ~toggle-input-method~ 的功能。\n\n示例配置如下：\n#+begin_src elisp\n(defun rime-commit1-and-toggle-input-method ()\n  \"Commit the 1st item if exists, then toggle input method.\"\n  (interactive)\n  (ignore-errors (rime-commit1))\n  (toggle-input-method))\n\n(global-set-key (kbd \"C-;\") #'rime-commit1-and-toggle-input-method)\n#+end_src\n这里使用了 =ignore-errors= 来防止在初次切换输入法时 =rime-commit1= 未被加载而报错。\n在此配置生效后，按 =C-;= 即可使首项自动上屏并切换输入法。\n*** 对任意无关函数首项自动上屏\n若你有很多函数需要在其执行前首项自动上屏，而又不想对它们一个个进行自定义函数与绑定的配置，你可以设置对任意与 emacs-rime 无关函数的首项自动上屏。\n\n机制：\n- 在 emacs-rime 的输入状态下，若执行与 emacs-rime 无关的函数，默认会触发 =rime--clear-state= 清空候选框。\n- 若设置变量 =rime-commit1-forall= 为一非 nil 值，则会将触发的函数改为 =rime-commit1= 即首项自动上屏。\n\n示例配置如下：\n#+begin_src elisp\n(setq rime-commit1-forall t)\n#+end_src\n*** 按 ESC 时首项自动上屏\n上述全局设置，不能使得在输入时按 ESC 时首项也自动上屏，这里给出针对性的配置方法。\n\n机制：在 emacs-rime 的输入状态下，ESC 被绑定到了 =rime--escape= 函数上，此函数显然不是“与 emacs-rime 无关的函数”。\n\n实例：以 evil 插件为例，若要使得 ESC 能自动上屏并切换到 evil 的 normal state，可以先自定义函数，并将此函数绑定到 ESC 上。\n（注：至少对于 evil 插件而言， =C-[= 和 =ESC= 被 emacs 当作同一按键，所以不需要对 =C-[= 另行绑键。）\n\n示例配置如下：\n#+begin_src elisp\n(defun rime-commit1-and-evil-normal ()\n  \"Commit the 1st item if exists, then go to evil normal state.\"\n  (interactive)\n  (rime-commit1)\n  (evil-normal-state))\n(define-key rime-active-mode-map (kbd \"\u003cescape\u003e\") 'rime-commit1-and-evil-normal)\n#+end_src\n** 在 minibuffer 使用后自动关闭输入法\n\n默认行为为自动关闭，设置 ~rime-deactivate-when-exit-minibuffer~ 为 nil 取消该行为。\n\n** 结合 evil-escape 一起使用\n#+html: \u003cdetails\u003e\n#+html: \u003csummary\u003e切换折叠\u003c/summary\u003e\n*以下代码可能有性能问题*\n\n在你的配置中添加如下内容，即可在当前没有输入内容（没有 preedit overlay）的情况\n下，用[[https://github.com/syl20bnr/evil-escape][evil-escape]]的按键回到 normal 模式。\n\n#+BEGIN_SRC emacs-lisp\n  (defun rime-evil-escape-advice (orig-fun key)\n    \"advice for `rime-input-method' to make it work together with `evil-escape'.\n          Mainly modified from `evil-escape-pre-command-hook'\"\n    (if rime--preedit-overlay\n        ;; if `rime--preedit-overlay' is non-nil, then we are editing something, do not abort\n        (apply orig-fun (list key))\n      (when (featurep 'evil-escape)\n        (let (\n              (fkey (elt evil-escape-key-sequence 0))\n              (skey (elt evil-escape-key-sequence 1))\n              )\n          (if (or (char-equal key fkey)\n                  (and evil-escape-unordered-key-sequence\n                       (char-equal key skey)))\n              (let ((evt (read-event nil nil evil-escape-delay)))\n                (cond\n                 ((and (characterp evt)\n                       (or (and (char-equal key fkey) (char-equal evt skey))\n                           (and evil-escape-unordered-key-sequence\n                                (char-equal key skey) (char-equal evt fkey))))\n                  (evil-repeat-stop)\n                  (evil-normal-state))\n                 ((null evt) (apply orig-fun (list key)))\n                 (t\n                  (apply orig-fun (list key))\n                  (if (numberp evt)\n                      (apply orig-fun (list evt))\n                    (setq unread-command-events (append unread-command-events (list evt))))))\n                )\n            (apply orig-fun (list key)))))))\n\n  (advice-add 'rime-input-method :around #'rime-evil-escape-advice)\n#+END_SRC\n#+html: \u003c/details\u003e\n\n#+html: \u003c/details\u003e\n* 五、杂项\n#+html: \u003cdetails\u003e\n#+html: \u003csummary\u003e切换折叠\u003c/summary\u003e\n** 打开 Rime 菜单\n\n假设你为菜单使用 ~C-~~ 。\n\n#+begin_src yaml\n  switcher:\n    caption: 〔方案選單〕\n    hotkeys:\n      - Control+grave\n#+end_src\n\n你可用函数 ~rime-send-keybinding~ 将此按键绑定到 ~rime-mode-map~ 。\n\n#+begin_src emacs-lisp\n  (use-package\n    ...\n\n    :bind\n    (:map rime-mode-map\n          (\"C-`\" . 'rime-send-keybinding))\n    ...\n    )\n#+end_src\n\n#+html: \u003c/details\u003e\n* 六、FAQ\n#+html: \u003cdetails\u003e\n#+html: \u003csummary\u003e切换折叠\u003c/summary\u003e\n** 在 isearch 中的使用\n\n目前在 isearch 中不能正常工作，但是可以使用 [[https://github.com/zk-phi/phi-search][phi-search]].\n\n** 候选框最后一项不显示？\n#+html: \u003cdetails\u003e\n#+html: \u003csummary\u003e切换折叠\u003c/summary\u003e\n极少数用户下会偶尔出现最后一个候选词不显示的情况，可以确定跟 `posframe` 有关，但\n目前尚未找到原因，有一个暂时的解决办法，就是给候选词列表最后附加一个全角空格，这\n样即使出现“吃字”的情况也只是把末尾的全角空格“吃”掉，不会影响候选词的显示。\n代码如下：\n#+BEGIN_SRC emacs-lisp\n  (defun +rime--posframe-display-content-a (args)\n    \"给 `rime--posframe-display-content' 传入的字符串加一个全角空\n格，以解决 `posframe' 偶尔吃字的问题。\"\n    (cl-destructuring-bind (content) args\n      (let ((newresult (if (string-blank-p content)\n                           content\n                         (concat content \"　\"))))\n        (list newresult))))\n\n  (if (fboundp 'rime--posframe-display-content)\n      (advice-add 'rime--posframe-display-content\n                  :filter-args\n                  #'+rime--posframe-display-content-a)\n    (error \"Function `rime--posframe-display-content' is not available.\"))\n#+END_SRC\n#+html: \u003c/details\u003e\n\n** 无需 librime 纯 Emacs 实现的输入法？\n\n你可能需要 [[https://github.com/tumashu/pyim][pyim]].\n\n#+html: \u003c/details\u003e\n* 终、感谢所有的 Contributor\n\n- [[https://github.com/Z572][Z572]]\n- [[https://github.com/cnsunyour][cnsunyour]]\n- [[https://github.com/shuxiao9058][shuxiao9058]]\n- [[https://github.com/lkzz][lkzz]]\n- [[https://github.com/wsw0108][wsw0108]]\n- [[https://github.com/HesperusArcher][HesperusArcher]]\n- [[https://github.com/longminwang][longminwang]]\n- [[https://github.com/chuxubank][chuxubank]]\n- [[https://github.com/jixiuf][jixiuf]]\n- [[https://github.com/cireu][cireu]]\n- [[https://github.com/ilupin][ilupin]]\n- [[https://github.com/dwuggh][dwuggh]]\n- [[https://github.com/zilongshanren][zilongshanren]]\n- [[https://github.com/zhmars][zhmars]]\n- [[https://github.com/syohex][syohex]]\n- [[https://github.com/pmeiyu][pmeiyu]]\n- [[https://github.com/p1uxtar][p1uxtar]]\n- [[https://github.com/gemone][gemone]]\n- [[https://github.com/casouri][casouri]]\n- [[https://github.com/Tubo][Tubo]]\n- [[https://github.com/Eason0210][Eason0210]]\n- [[https://github.com/wang1zhen][wang1zhen]]\n- [[https://github.com/shenlebantongying][shenlebantongying]]\n- [[https://github.com/nasyxx][nasyxx]]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDogLooksGood%2Femacs-rime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDogLooksGood%2Femacs-rime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDogLooksGood%2Femacs-rime/lists"}