Closed oxsardbest closed 10 months ago
以下函数已在我配置中定义.
(defun my-grep-pinyin-in-current-directory ()
"Grep pinyin in current directory."
(interactive)
;; grep Chinese using pinyinlib.
;; In ivy filter, trigger key must be pressed before filter chinese
(require 'counsel-etags)
(let* ((counsel-etags-convert-grep-keyword
(lambda (keyword)
(cond
((> (length keyword) 0)
(require 'pinyinlib)
;; only grep simplified Chinese
(pinyinlib-build-regexp-string keyword t nil t))
(t
keyword)))))
(counsel-etags-grep-current-directory)))
windows下使用需要开启utf-8支持, 因为windows默认命令行使用utf-16编码.
抱歉,果然已经实现了,点赞
就是,dd这个按键对应的功能,输入中文直接查询会返回空内容,英文倒是没问题,ivy您hack过了,:加首字母没问题,但是不知道,dd怎么查中文。