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
  • 77,472
  • 10
  • 114
  • 243
cammil
  • 509
  • 3
  • 12

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
  • 50,977
  • 3
  • 79
  • 122
  • 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