0

I'm trying to do the following:

  • find all buffers containing text "foo"
  • visit each of those buffers to perform some edition

Using helm-rg, I'm forced to do this:

  • M-x helm-rg
  • Enter the text I'm looking for (foo)
  • Move in the helm-rg buffer to the first file
  • Press RET to visit the first file
  • Do my edits in this first file, save the buffer
  • M-x helm-rg
  • Enter the text I'm looking for (foo)
  • Move in the helm-rg buffer to the second file
  • Press RET to visit the second file
  • Do my edits in this second file, save the buffer
  • M-x helm-rg
  • ... etc, etc...

This gets tedious pretty quickly, and there has to be a better way. Some research mention using helm-follow-mode, or helm-resume, but in my setup it does not change anything (helm-resume does nothing after visiting a file from helm-rg.)

What would be the smart thing to do here ?

phtrivier
  • 135
  • 5
  • maybe able to do with a package [wgrep](https://github.com/mhayashi1120/Emacs-wgrep) and possibly [wgrep-helm](https://github.com/mhayashi1120/Emacs-wgrep/blob/master/wgrep-helm.el) or [Embark](https://github.com/oantolin/embark) (which can export the grep (also rg, occur, etc.) result for the other action, such as `wgrep`) together. – roomworoof May 12 '23 at 14:07
  • `multi-occur-in-matching-buffers` perhaps? At least, all the matches stay in the *Occur* buffer so you don't have to repeat the search, just choose and click the next match. And `next-error` (``C-x ` ``) works to go to the next match. – NickD May 12 '23 at 21:44

0 Answers0