Edit buffer while keeping Helm results open
Asked Answered
K

3

15

Is it possible to visit a buffer from the result list of Helm while keeping the Helm buffer open? Or is there some other way of achieving the same effect?

I often need to do tasks that involve searching some files, and visit each of them, but the way it works now I have to redo the search everytime I'm done visiting a buffer.

EDIT: FWIW, if using spacemacs, SPC r l is bound to helm-resume

Kentonkentucky answered 27/3, 2015 at 10:7 Comment(3)
What do you mean by "some other way of achieving the same effect"? What is the effect? I.e., just what is the need/request? Is it Helm-specific? If not, can it be stated simply as "searching some files, and edit each of them" without exiting search?Frivolity
I think a more accurate version would be "search some files, and visit a result without exiting search"Kentonkentucky
I've edited your question to reflect that clarification, replacing "edit" with "visit". That makes more sense, to me. If you edit a buffer then it makes sense that you somehow then need to resume searching ("redo the search") when you are done editing it.Frivolity
M
15

You can revive the last Helm session with the helm-resume command (bound by default to Ctrl-x c b). This should effectively achieve what you want.

You can also save the search results to a buffer with Ctrl-x Ctrl-s.

Marjana answered 10/6, 2015 at 8:0 Comment(2)
What is the command's name? I have C-c b bound to something else.Kentonkentucky
@altschuler: sorry the key combination was wrong. Fixed now and added the respective command.Marjana
S
3

helm-follow-mode will show the results of a helm list while moving the cursor point up and down the helm results list.

For example in Spacemacs, SPC T s opens helm with a list of themes, C-c C-f activates helm-follow-mode and now the themes are applied when navigating up and down the list.

Silverman answered 23/4, 2020 at 23:51 Comment(0)
F
2

Icicles lets you do this. With Icicles search you can navigate among the search hits (across the set of searched buffers or files).

You can cycle among the search hits, but you need not cycle. You can visit any hits you choose, in any order. You can dynamically filter the hits by typing a filter pattern, which you can change on the fly.

You can combine multiple such dynamic filter patterns, using several simple patterns in place of a more complex one. Pattern matching can use apropos (regexp) matching or any of several kinds of fuzzy matching. You can also filter by chipping away dynamic matches, subtracting them from the current, wider set of matches.

You can even search, not the search contexts you defined at the outset of searching, but their complement.

(Icicles search lets you define the contexts to search - for example, only function definitions or only comments. Other text is ignored (not searched). The simplest example is the lines of a buffer as search contexts. Line search contexts are what grep, occur, and icicle-occur use.)

You can also replace individual search hits, or the parts of them that match your current input pattern, on demand, without exiting Icicles search. And you can change the replacement text anytime during search, on demand.

In the limited sense of such replacement you can thus not only visit the searched buffers but edit them, without ever exiting search.

Frivolity answered 5/4, 2015 at 15:36 Comment(1)
My first thought was "why is there an irrelevant answer about Icicles?". But hey, it sounds pretty good!Capote

© 2022 - 2024 — McMap. All rights reserved.