diff options
-rw-r--r-- | init.el | 9 | ||||
-rw-r--r-- | lisp/acdw-consult.el | 23 |
2 files changed, 25 insertions, 7 deletions
diff --git a/init.el b/init.el index 1948783..acdea0c 100644 --- a/init.el +++ b/init.el | |||
@@ -1044,6 +1044,15 @@ like a dumbass." | |||
1044 | (apheleia--get-formatter-command))) | 1044 | (apheleia--get-formatter-command))) |
1045 | (indent-region (point-min) (point-max)))))) | 1045 | (indent-region (point-min) (point-max)))))) |
1046 | 1046 | ||
1047 | (setup (:straight-if affe | ||
1048 | (executable-find "rg")) | ||
1049 | ;; Keys are bound in `acdw/sensible-grep' and `acdw/sensible-find' | ||
1050 | (defun affe-orderless-regexp-compiler (input _type) | ||
1051 | (setq input (orderless-pattern-compiler input)) | ||
1052 | (cons input (lambda (str) (orderless--highlight input str)))) | ||
1053 | |||
1054 | (:option affe-regexp-compiler #'affe-orderless-regexp-compiler)) | ||
1055 | |||
1047 | (setup (:straight async) | 1056 | (setup (:straight async) |
1048 | (autoload 'dired-async-mode "dired-async.el" nil t) | 1057 | (autoload 'dired-async-mode "dired-async.el" nil t) |
1049 | (dired-async-mode +1)) | 1058 | (dired-async-mode +1)) |
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' |
10 | if ripgrep is installed, otherwise `consult-grep'." | 10 | if 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) |