Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ripgrep-all #86

Open
arenzana opened this issue Jul 7, 2020 · 2 comments
Open

Support for ripgrep-all #86

arenzana opened this issue Jul 7, 2020 · 2 comments

Comments

@arenzana
Copy link

arenzana commented Jul 7, 2020

I LOVE deadgrep and use it pretty much daily. One thing I just recently found was this project: https://github.com/phiresky/ripgrep-all. It allows for search inside all type of file formats (including pdf, which is the one I'm interested in particularly).

Not sure this is technically possible or worth the time, but ripgrep-all as an alternative engine would be amazing!

@JohnJohnstone
Copy link

I found this issue whilst attempting to use ripgrep-all to search pdf with deadgrep. I have just set the variable deadgrep-executable to rga seems to be working fine so far.

@pierre-rouleau
Copy link
Contributor

pierre-rouleau commented Jun 10, 2024

@Wilfred, Although it's true you can set the deadgrep-executable user-option to "rga" it would be nice to be able to either be able to:

  • dynamically change the deadgrep-executable from within a deadgrep-mode buffer. Which would allow anyone to change the executable for a given buffer only, or
  • provide a second command that use another user-option.

I tried the following code that almost does the job of providing a ripgrep-all even when the deadgrep-executable is set to ripgrep. Unfortunately the hook activates it for the remainder of the Emacs session and it affects all buffers:

(defun deadgrep-all-setup ()
  "Use rga in deadgrep buffer."
  (setq-local deadgrep-executable "rga"))

(defun deadgrep-all (search-term)
  "Search with rga."
  (interactive (list (deadgrep--read-search-term)))
  (let ((deadgrep-executable "rga"))
    (add-hook 'deadgrep-mode-hook 'deadgrep-all-setup)
    (deadgrep search-term)))

The advantage of being able to select ripgrep-all just sometimes, is that ripgrep is faster. Some people may want to use ripgrep-all just sometimes, and would't want to switch to ripgrep-all for all of their searches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants