1

I use projectile and helm-projectile. Sometimes I like to use helm-projectile-grep to explore the code dynamically, and sometimes I know what I am looking for and I want the speed, and persistence of projectile-grep.

However, when I map projectile-grep to a key, when I use that key it seems to call helm-projectile-grep. This is my current config:

(use-package projectile
  :ensure t
  :demand t
  :config
  (projectile-mode +1)
  (define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
  (setq projectile-switch-project-action 'projectile-dired)
  (define-key projectile-command-map (kbd "g") 'projectile-grep))

(use-package helm-projectile
  :ensure t
  :demand t
  :after (projectile)
  :bind ("s-f" . helm-projectile-find-file)
  :config
  (helm-projectile-on))

How can I use separate key bindings for helm-projectile-grep and projectile-grep?

3
  • Does this answer your question? How to unbind a key?
    – Drew
    Commented Jun 8, 2020 at 14:49
  • I can't see how it does.
    – cammil
    Commented Jun 8, 2020 at 16:02
  • You ask how you can remove a command remapping. That's the same as asking how you unbind the [remap ___] pseudo key, i.e., how to unbind it. And the answer is to bind it to nil.
    – Drew
    Commented Jun 8, 2020 at 23:21

1 Answer 1

3

Assuming that helm-projectile is doing this:

(define-key projectile-mode-map [remap projectile-grep] #'helm-projectile-grep)

You would disable that with:

(define-key projectile-mode-map [remap projectile-grep] nil)
2
  • Should projectile-command-map be projectile-mode-map ? If so this seems to work for me.
    – cammil
    Commented Jun 8, 2020 at 15:59
  • Cool, I'll update the answer. I was just basing that on the (define-key projectile-command-map (kbd "g") 'projectile-grep)) code that you'd shown.
    – phils
    Commented Jun 8, 2020 at 20:38

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.