From 7936875a2f21a3b0952c732016ab3e0e8a632205 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 11 Aug 2021 22:05:43 -0500 Subject: Use Orderless Regexp Compiler for consult --- init.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'init.el') diff --git a/init.el b/init.el index 8feab77..9aa18a4 100644 --- a/init.el +++ b/init.el @@ -911,6 +911,15 @@ if ripgrep is installed, otherwise `consult-grep'." (cond ((executable-find "locate") (call-interactively #'consult-locate)) (t (call-interactively #'consult-find)))) + ;; Orderless Regexp Compiler! -- from Consult Wiki + (defun consult--orderless-regexp-compiler (input type) + (setq input (orderless-pattern-compiler input)) + (cons + (mapcar (lambda (r) (consult--convert-regexp r type)) input) + (lambda (str) (orderless--highlight input str)))) + + (setq consult--regexp-compiler #'consult--orderless-regexp-compiler) + ;; Bindings (:global ;; C-c bindings (`mode-specific-map') -- cgit 1.4.1-21-gabe81