Saving and loading the *rg*
buffer works for me as the saved file's first line is -*- mode: rg; default-directory: "/path/to/dir/" -*-
to enable rg-mode
on load. How are you saving the buffer?
Emacs
A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!
Get Emacs
Rules
- Posts should be emacs related
- Be kind please
- Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.
Emacs Resources
Emacs Tutorials
- Beginner’s Guide to Emacs
- Absolute Beginner's Guide to Emacs
- How to Learn Emacs: A Hand-drawn One-pager for Beginners
Useful Emacs configuration files and distributions
Quick pain-saver tip
Thanks for your answer. I just use C-x C-s for saving the buffer.
embark-export is your friend, I use it all the time!
Thanks!
using embark, you need to set a keybind to embark, then use the ripgrep normally, when the minibuffer returns the results, call the embark via keybind and use embark-export
, that is bind to E
, then embark will create a buffer with the results from minibuffer
Thanks for your help. Embark looks interesting, although the rg search results are not shown in a mini buffer, but in a normal buffer.
for rg search, are you using (the amazing) consult-ripgrep
?
* in my emacs configuration at least
I would use Embark for this:
C-. (embark-act)
follow by
S (embark-collect)
This will convert whatever content you have in the mini-buffer into an ordinary buffer that you can keep, browse and even save.
Not sure that matches your need, but rg.el (https://github.com/dajva/rg.el) has rg-list-searches
, which will list your searches in an "Ibuffer" buffer.
Should be available for as long as Emacs session and saveable if needed.
I use consult-ripgrep and consult-repeat to run last search again.