helm swoop is very good, it could show me the lines matching some word, but I need to edit the lines around the matching line. How to do that? I can only view the them. I tried to use mouse to position the line I want to modify, but it doesn't work.
2 Answers
For this purpose there is helm-resume
. It allows you to 'continue' with the previous helm session.
I.e, your flow would be as following:
1. Fire up helm session .
2. Select the item to edit. Press RET to jump to that place to edit it..
3. Run helm-resume
(C-c h b) and you should be back in your previous session.
You can tie it to some more convienient short cut like:
(global-set-key (kbd "<f5>") 'helm-resume)
There is also a detailed explanation about helm-resume and helm in general: http://tuhdo.github.io/helm-intro.html#ID-9d698347-33ee-447d-9fd1-eb01e9770dbb
Please let me know if you have further questions.
You should use Helm-Swoop's Multiline Behavior. Basically you specify the number using a prefix argument (C-u n M-x helm-swoop )of context lines to use in helm swoop buffer. Then for the lines you want to modify you enter to edit mode using C-c C-e from the minibuffer.
PS: I'm rephrasing HeyYO's comment, as a proper answer as I share his solution.
C-x o
to switch into the buffer, making the edit, and usingC-x o
to switch back tohelm-swoop
work?M-3 M-x helm-swoop
, with a number argument, it will show extra lines around the matched line. Then you can useC-c C-e
to switch to edit mode. But in my case the way extra lines are shown was inconsistent, sometimes after the matched line sometimes before it. So It may not be usable for you. Occur mode has the same usage. Maybe you should try it instead.