I do helm-find-files (C-x c C-x C-f>), Tab, "Grep current directory with AG" (M-g a), enter pattern, Tab, "Save results in grep buffer" (F3). Now, how do I make M-g M-n/M-g M-p work with helm in a sibling buffer, like with rgrep? I was able to achieve this with projectile + rg (C-c p s r).
1 Answer
I don't see a feature like that in helm-grep. But you should achieve the desired result with a function like this one
(defun my/jump-next-grep-result () (interactive) (other-window 1) (next-logical-line) (helm-grep-mode-jump-other-window-forward 1) (other-window -1)) - I wonder is this a bug or a feature that
helmdoesn't have this. To me this is what I occasionally need. I tried discussing it was a contributor/maintainer, and he doesn't agree. Maybe I'm doing it wrong...x-yuri– x-yuri2021-10-13 06:41:10 +00:00Commented Oct 13, 2021 at 6:41
M-gM-n... work withhelm? If I doM-nin the grep buffer a new window is opened showing the found line in the original file.M-nin the grep buffer is bound tohelm-grep-mode-jump-other-window-forward.M-x rgrepEnter(search for)some text(that is present in some files)Enter(in files)allEnter(base directory)/some/pathEnter. After that you get 2 windows: a file with a match and a list of matches. You can useM-g M-p/M-g M-nin the first window to visit the other matches, even those in the other files. You don't have to switch to the grep buffer to visit the next match. More info is at the link in the question.