emacsorphanage / helm-swoop

Efficiently hopping squeezed lines powered by Emacs helm interface
GNU General Public License v3.0
689 stars 55 forks source link

[feature request] Make symbol-at-point behavior configurable #18

Closed betaprior closed 10 years ago

betaprior commented 10 years ago

I often use helm-swoop just like I would M-x occur, or isearch; when I invoke it, I intend to type the string I will be searching for. Current default behavior forces me to delete the search string if it's pre-populated by symbol at point. It would be nice to give the user an option to turn off this behavior, or provide a version where symbol at point could be easily added to search string (just like C-w when doing isearch).

ShingoFukuyama commented 10 years ago

Thanks for request. That's a good point, and I've added an option like below.

(setq helm-swoop-pre-input-function
      (lambda () (thing-at-point 'word)))

;; Reuse the last query
(setq helm-swoop-pre-input-function
      (lambda () helm-swoop-last-query))

;; Set empty
(setq helm-swoop-pre-input-function
      (lambda () ""))

It might not be smart, but I guess it's configurable.