feat(chinese): add evil-pinyin

Ref: #6356
Close: #6482
Co-authored-by: merrickluo <merrickluo@users.noreply.github.com>
This commit is contained in:
Henrik Lissner 2023-02-23 02:30:33 -05:00
parent 051c31109f
commit 8658145447
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
3 changed files with 16 additions and 1 deletions

View file

@ -17,6 +17,7 @@ methods: Pinyin and Wubi.
** Packages ** Packages
- [[doom-package:ace-pinyin]] - [[doom-package:ace-pinyin]]
- [[doom-package:chinese-wbim]] if [[doom-module:+wubi]] - [[doom-package:chinese-wbim]] if [[doom-module:+wubi]]
- [[doom-package:evil-pinyin]] if [[doom-module::editor evil +everywhere]]
- [[doom-package:fcitx]] - [[doom-package:fcitx]]
- [[doom-package:liberime]] if [[doom-module:+rime]] - [[doom-package:liberime]] if [[doom-module:+rime]]
- [[doom-package:pangu-spacing]] - [[doom-package:pangu-spacing]]

View file

@ -10,7 +10,11 @@
;; allow vertico/selectrum search with pinyin ;; allow vertico/selectrum search with pinyin
(cond ((modulep! :completion vertico) (cond ((modulep! :completion vertico)
(advice-add #'orderless-regexp :filter-return #'pyim-cregexp-build-regexp-string)) (advice-add #'orderless-regexp
:filter-return
(if (modulep! :editor evil +everywhere)
#'evil-pinyin--build-regexp-string
#'pyim-cregexp-build-regexp-string)))
((modulep! :completion ivy) ((modulep! :completion ivy)
(setq ivy-re-builders-alist '((t . pyim-cregexp-ivy)))))) (setq ivy-re-builders-alist '((t . pyim-cregexp-ivy))))))
@ -51,6 +55,14 @@
:config (ace-pinyin-global-mode t)) :config (ace-pinyin-global-mode t))
(use-package! evil-pinyin
:when (modulep! :editor evil +everywhere)
:after evil
:config
(setq-default evil-pinyin-with-search-rule 'always)
(global-evil-pinyin-mode 1))
;; ;;
;;; Hacks ;;; Hacks

View file

@ -7,3 +7,5 @@
(package! pangu-spacing :pin "2303013e5cd7852136f1429162fea0e1c8cb0221") (package! pangu-spacing :pin "2303013e5cd7852136f1429162fea0e1c8cb0221")
(when (modulep! +rime) (when (modulep! +rime)
(package! liberime :pin "8291e22cd0990a99cb2f88ca67a9065a157f39af")) (package! liberime :pin "8291e22cd0990a99cb2f88ca67a9065a157f39af"))
(when (modulep! :editor evil +everywhere)
(package! evil-pinyin :pin "3e9e501ded86f88e01a4edec5d526ab0fab879d7"))