cofi / evil-leader

<leader> key for evil
GNU General Public License v3.0
315 stars 22 forks source link

Include minor modes #28

Open jbaum98 opened 8 years ago

jbaum98 commented 8 years ago

This allows you to use evil-leader/set-key-for-mode to set minor-mode specific maps. I think this also addresses #27.

lionel- commented 8 years ago

Thanks for writing this, much needed!

@cofi, any chance of including this? I am starting using it right now and will report back issues if any.

lionel- commented 8 years ago

One problem is that there's no guarantee evil-leader is the last loaded minor mode. So minor-mode-alist (which looks a bit hacky to use anyway) does not contain all relevant minor modes unless you reload the buffer.

I think a cleaner way to do this would involve adding local leader keys in minor modes' hooks.

(evil-leader/set-local-key) would probably have to account for the possibility of evil-leader not being active yet when the hook is run. So, if not yet loaded: add local variable containing local bindings. If already loaded: add local variable then relaunch evil-leader

jbaum98 commented 8 years ago

@lionel- I unquoted get-keymap-for-mode. I'm not quite sure how to implement this feature the way you suggested with minor mode hooks. I'm a relatively inexperienced emacs hacker, so could you explain more precisely how I would do it that way? Or if you want to implement it yourself, please feel totally free to do that. Thanks for your help!

lionel- commented 8 years ago

See #35 ;)

jbaum98 commented 8 years ago

Oh nice! Didn't see that.