emacs-Windows上使用Emacs
1. 字体编码处理
设置org-mode的字符编码,同时开启自动revert功能
(use-package lazy-revert :ensure nil ;; :quelpa (lazy-revert :fetcher github ;; :repo "yilin-zhang/lazy-revert") :hook (after-init . lazy-revert-mode) ;; Optional :config (setq auto-revert-verbose t ; let us know when it happens auto-revert-use-notify nil auto-revert-stop-on-user-input nil ;; Only prompts for confirmation when buffer is unsaved. revert-without-query (list "."))) (add-to-list 'file-coding-system-alist '("\\.org\\'" . utf-8))
设置ripgrep的字符编码
(add-to-list 'process-coding-system-alist '("[rR][gG]" . (utf-8 . gbk-dos)))
其他编码设置
(prefer-coding-system 'utf-8) (setq default-buffer-file-coding-system 'utf-8) (set-default 'process-coding-system-alist '(("[pP][lL][iI][nN][kK]" gbk-dos . gbk-dos) ("[cC][mM][dD][pP][rR][oO][xX][yY]" gbk-dos . gbk-dos)))
2. consult
2.1. 调用Everything进行搜索
下载命令行接口 es.exe
https://www.voidtools.com/zh-cn/downloads/#cli
consult配置
(use-package consult :defer t :init (progn (add-to-list 'process-coding-system-alist '("es" gbk . gbk)) (add-to-list 'process-coding-system-alist '("explorer" gbk . gbk)) (setq consult-locate-args (encode-coding-string "es.exe -i -p -r" 'gbk))) :custom (consult-async-min-input 2) ;;中文2字符开搜 )
模糊搜索技巧
貌似目前只能通过单个单词搜索之后,在搜索结果后面加上
#
再用orderless的规则去弄。
比如 搜索
#emacs#keyword1 keyword2
来过滤,此时可以添加空格