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
helm
doesn'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-yuriOct 13, 2021 at 6:41
M-g
M-n
... work withhelm
? If I doM-n
in the grep buffer a new window is opened showing the found line in the original file.M-n
in the grep buffer is bound tohelm-grep-mode-jump-other-window-forward
.M-x rgrep
Enter
(search for)some text
(that is present in some files)Enter
(in files)all
Enter
(base directory)/some/path
Enter
. 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-n
in 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.