helm-swoop icon indicating copy to clipboard operation
helm-swoop copied to clipboard

Feature Req: Start helm session with previous input

Open hura opened this issue 10 years ago • 3 comments

I think I'd be nice to start a helm swoop session with the previous input. Can this be easily achieved with the pre-input-function?

hura avatar Feb 16 '15 16:02 hura

M-x helm-resume could solve the issue? It's not helm-swoop specific, though.

Otherwise, try this :)

;; If there is no symbol at the cursor, use the last used words instead.
(setq helm-swoop-pre-input-function
      (lambda ()
        (let (($pre-input (thing-at-point 'symbol)))
          (if (eq (length $pre-input) 0)
              helm-swoop-pattern ;; this variable keeps the last used words
            $pre-input))))

ShingoFukuyama avatar Feb 22 '15 02:02 ShingoFukuyama

Thanks that's exactly what I needed. Feel free to accept or reject the PR that I just submitted if you think it's too trivial to be added to the README. Cheers

hura avatar Feb 22 '15 15:02 hura

So I have one last question: When I'm already in a helm swoop session, how can I pull the current Symbol under cursor into the search prompt (ie clearing the existing one). If this could be bound to some function we would have all the flexibility:

  • Start with previous search
  • Clear with C-Backspace
  • Load with symbol under point with ??>

IMO, that would be nice.

hura avatar Mar 03 '15 20:03 hura