From 1fb041fffce166c4e55a6bbde34089abf7b9eb96 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Sat, 12 Aug 2023 11:53:51 +0200 Subject: [PATCH] Emacs: Don't fuzzy search in consult-line --- .config/emacs/site-lisp/dot-keybinds.el | 3 ++- .config/emacs/site-lisp/dot-selection.el | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.config/emacs/site-lisp/dot-keybinds.el b/.config/emacs/site-lisp/dot-keybinds.el index d89b213..9f5a68c 100644 --- a/.config/emacs/site-lisp/dot-keybinds.el +++ b/.config/emacs/site-lisp/dot-keybinds.el @@ -505,7 +505,8 @@ "s l" '(avy-goto-line :which-key "Avy goto line") "s p" '(consult-grep :which-key "Search project") "s q" '(evil-ex-nohighlight :which-key "Stop search") - "s s" '(consult-line :which-key "Search buffer") + "s s" '(dot/consult-line-no-fuzzy :which-key "Search buffer") + "s S" '(consult-line-multi :which-key "Search all buffers") ;; Tabs / toggle "t" '(:ignore t :which-key "tabs/toggle") diff --git a/.config/emacs/site-lisp/dot-selection.el b/.config/emacs/site-lisp/dot-selection.el index 4a9d67f..e8b90ea 100644 --- a/.config/emacs/site-lisp/dot-selection.el +++ b/.config/emacs/site-lisp/dot-selection.el @@ -58,7 +58,18 @@ (elpaca-setup consult (:load-after vertico) - (:when-loaded (setq consult-narrow-key (kbd "?")))) + (:when-loaded + (setq consult-narrow-key (kbd "?")) + + (defun dot/consult-line-no-fuzzy () + "Call consult-line without fuzzy matching." + (interactive) + (let ((prescient-filter-method (delete 'fuzzy (copy-tree prescient-filter-method)))) + (consult-line))) + + (consult-customize + dot/consult-line-no-fuzzy :prompt "Search: " + consult-line-multi :prompt "Search: " :initial nil))) (elpaca-setup consult-flycheck (:load-after consult flycheck))