0

I am using spacemacs with vim bindings and doing a search project-wide for something like while \( with SPC s p. I get the results in a helm buffer and can enter transient state to navigate them, but once I open one of the listed files, the search disappears and C-o does not get me back to it. I am forced to repeat the search.

For doing project-wide refactors this is pretty inconvenient. In my situation it's not a simple search and replace. I have to inspect each use and determine if I need to refactor.

Is there any way to preserve the search results so I can go through the results and return to them?

I saw in the help menu C-c o to open results in a new buffer, but that seems to just open a new buffer with the same file I was on, not the results.

1 Answer 1

2

You can toggle helm-follow-mode using C-c C-f within a helm buffer, then when cycling through helm you will see previews of the results. You can switch to the results buffer by typing M-1 and then switch back to the helm buffer by typing M-2 or SPC w w.

Also, after you have closed the helm buffer, e.g. by selecting/visiting one of its results by pressing RET on it, you can use M-x helm-resume or SPC r l to reopen the last results in helm.

3
  • Very nice! I particularly like helm-resume, as I could even use it without helm-follow-mode. Where did you find the M-1 bindings documented? I didn't find them in the helm layer docs. Jan 6 at 16:56
  • I don't remember where I found that, I think either someone told me about it, or I just discovered it at some point as an alternative to SPC 1..2 etc. (which does not work in helm of course). It is a general global keybinding, but I can not find any place where it is documented. Jan 6 at 21:49
  • Interesting, thanks for checking! Jan 7 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.