0

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.

  • Would doing C-x o to switch into the buffer, making the edit, and using C-x o to switch back to helm-swoop work? – PythonNut Apr 15 '15 at 20:20
  • it doesn't work, since the buffer of swoop doesn't look like a window and c-x o can't switch between them – Daniel Wu Apr 16 '15 at 0:52
  • When you start helm-swoop like this M-3 M-x helm-swoop, with a number argument, it will show extra lines around the matched line. Then you can use C-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. – HeyYO Apr 16 '15 at 9:57
  • Hello, I was wondering if the answer below is lacking something that you need. If so, please feel free to leave a comment below it and I'll see if it we can accommodate your need. Otherwise please feel free to mark the answer as accepted. – Leo Ufimtsev May 7 '15 at 20:53
3

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.

2

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.

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.