From 051c31109f0f5816304a2fa8fa310b1ef0e0b41f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 23 Feb 2023 02:28:38 -0500 Subject: [PATCH] feat(chinese): search anything with pinyin - Advise orderless to use pyim-cregexp-build when using vertico - Add it to ivy-re-builders-alist when using ivy Close: #6482 Co-authored-by: merrickluo --- modules/input/chinese/config.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/input/chinese/config.el b/modules/input/chinese/config.el index 4334f2734..1dbe32753 100644 --- a/modules/input/chinese/config.el +++ b/modules/input/chinese/config.el @@ -6,7 +6,13 @@ (setq pyim-dcache-directory (concat doom-cache-dir "pyim/")) :config (setq pyim-page-tooltip t - default-input-method "pyim")) + default-input-method "pyim") + + ;; allow vertico/selectrum search with pinyin + (cond ((modulep! :completion vertico) + (advice-add #'orderless-regexp :filter-return #'pyim-cregexp-build-regexp-string)) + ((modulep! :completion ivy) + (setq ivy-re-builders-alist '((t . pyim-cregexp-ivy)))))) (use-package! liberime