I have a key binding that's bounded to helm-for-files
.
(define-key evil-normal-state-map (kbd "<f9>") 'helm-for-files)
But when I enter a directory which is a project (to being recognized with .projectile
file), then I would like to change the key binding to the following:
(define-key evil-normal-state-map (kbd "<f9>") 'helm-projectile)
.
But when I enter another directory without any project files, then revert back to the default helm-for-files
key binding.
I looked if there a hook for Projectile exists, but there isn't any hook available. Any other suggestions, to detect if I'm currently in a Projectile directory?
helm-projectile
when pressing<f9>
? I'm asking it, becausehelm-for-files-preffered-list
will not work with projectile sources if I'm not inside a project. – ReneFroger Jun 05 '15 at 10:00helm-for-files
? EDIT: I updated the answer to usewindow-configuration-change-hook
. With that hook, it should work when you switch buffer with Helm. – Tu Do Jun 05 '15 at 10:29helm-for-files
would be ideal. But I wonder why I can't addhelm-source-projectile-buffer-list
, hence my question to switch the keybindings. – ReneFroger Jun 05 '15 at 10:51helm-source-projectile-buffer-list
. I tried your edit, but I prefer my solution, because it allows you to order your sources list inhelm-for-files
more consistently. – ReneFroger Jun 05 '15 at 12:28