Skip to content

Instantly share code, notes, and snippets.

@jthaman
Last active January 5, 2023 14:49
Embed
What would you like to do?
Call ripgrep-all in emacs with consult
;; Note: put `rga' in your PATH. Or modify `cmd'.
(require 'consult)
;; helper function for ripgrep-all
(defun consult--ripgrep-all (&optional dir initial)
"Search with `rga' for files in DIR where the content matches a regexp.
The initial input is given by the INITIAL argument. See `consult-grep'
for more details."
(interactive "P")
(consult--grep "Ripgrep-all" #'consult--ripgrep-make-builder dir initial))
;;;###autoload
(defun consult-ripgrep-all ()
;; Bind to a key
(interactive)
(let ((consult-ripgrep-args "rga --null --line-buffered --color=never --max-columns=1000 --path-separator / --smart-case --no-heading --line-number ."))
(consult--ripgrep-all)))
(provide 'consult-ripgrep-all)
@arstum
Copy link

arstum commented Jan 3, 2023

Debugger entered--Lisp error: (void-function consult--ripgrep-builder)

@jthaman
Copy link
Author

jthaman commented Jan 4, 2023

The error means that you don't have `consult--ripgrep-builder' installed on your system. It is because the Consult author renamed it. I tried to fix plz check.

@arstum
Copy link

arstum commented Jan 5, 2023

What the script running version of consult?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment