about summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw-consult.el23
1 files changed, 16 insertions, 7 deletions
diff --git a/lisp/acdw-consult.el b/lisp/acdw-consult.el index e6995f5..58a2136 100644 --- a/lisp/acdw-consult.el +++ b/lisp/acdw-consult.el
@@ -9,17 +9,26 @@
9 "Perform `consult-git-grep' if in a git project, otherwise `consult-ripgrep' 9 "Perform `consult-git-grep' if in a git project, otherwise `consult-ripgrep'
10if ripgrep is installed, otherwise `consult-grep'." 10if ripgrep is installed, otherwise `consult-grep'."
11 (interactive "P") 11 (interactive "P")
12 (cond ((executable-find "rg") 12 (call-interactively
13 (call-interactively #'consult-ripgrep)) 13 (cond ((executable-find "rg")
14 ((string-equal (vc-backend buffer-file-name) "Git") 14 (if (fboundp 'affe-grep)
15 (call-interactively #'consult-git-grep)) 15 #'affe-grep
16 (t (call-interactively #'consult-grep)))) 16 #'consult-ripgrep))
17 ((string-equal (vc-backend buffer-file-name) "Git")
18 #'consult-git-grep)
19 (t #'consult-grep))))
17 20
18(defun acdw-consult/sensible-find (&optional arg) 21(defun acdw-consult/sensible-find (&optional arg)
19 "Peform `consult-locate' if locate is installed, otehrwise `consult-find'." 22 "Peform `consult-locate' if locate is installed, otehrwise `consult-find'."
20 (interactive "P") 23 (interactive "P")
21 (cond ((executable-find "locate") (call-interactively #'consult-locate)) 24 (call-interactively
22 (t (call-interactively #'consult-find)))) 25 (cond ((executable-find "locate")
26 #'consult-locate)
27 ((fboundp 'affe-find)
28 (when (executable-find "fd")
29 (setq affe-find-command "fd -HI -t f"))
30 #'affe-find)
31 (t #'consult-find))))
23 32
24;; Orderless Regexp Compiler! -- from Consult Wiki 33;; Orderless Regexp Compiler! -- from Consult Wiki
25(defun consult--orderless-regexp-compiler (input type) 34(defun consult--orderless-regexp-compiler (input type)