3

I want to use the current word as the input when I do helm-projectile-ag. That saves me the typing work. I didn't see this option in customize.

How would I implement that?

2 Answers 2

9

Found it. The setting is

(setq helm-ag-insert-at-point 'symbol)

Reference: https://github.com/syl20bnr/spacemacs/issues/1848#issuecomment-108973505

0

IMHO, the helm-ag-insert-at-point is only applicable to helm-ag, not helm-projectile-ag.

I think you should use following elisp snippet: https://github.com/ageldama/configs/blob/master/emacs/dot-emacs-2018#L252

(defun my-helm-projectile-rg--region-selection (old-fn &rest arguments)
  (let ((thing (thing-at-point 'symbol)))
    (if (null thing)
        (apply old-fn arguments)
      thing)))

(advice-add #'helm-projectile-rg--region-selection
            :around #'my-helm-projectile-rg--region-selection)
2
  • 3
    This is not necessary, (setq helm-ag-insert-at-point 'symbol) works for helm-projectile-ag
    – bpaul
    Commented Sep 26, 2018 at 17:43
  • To back up the first comment. This is not true - 'symbol works just fine. You should edit or remove your reply.
    – RichieHH
    Commented Dec 11, 2019 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.