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

@ -10,7 +10,11 @@
;; allow vertico/selectrum search with pinyin
(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)
(setq ivy-re-builders-alist '((t . pyim-cregexp-ivy))))))
@ -51,6 +55,14 @@
: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