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?

Drew
  • 75,699
  • 9
  • 109
  • 225
cammil
  • 509
  • 3
  • 12
  • Does this answer your question? [How to unbind a key?](https://emacs.stackexchange.com/questions/12383/how-to-unbind-a-key) – Drew Jun 08 '20 at 14:49
  • I can't see how it does. – cammil Jun 08 '20 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 Jun 08 '20 at 23:21

1 Answers1

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)
phils
  • 48,657
  • 3
  • 76
  • 115
  • Should `projectile-command-map` be `projectile-mode-map` ? If so this seems to work for me. – cammil Jun 08 '20 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 Jun 08 '20 at 20:38