evil-leader icon indicating copy to clipboard operation
evil-leader copied to clipboard

Include minor modes

Open jbaum98 opened this issue 8 years ago • 5 comments

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

jbaum98 avatar Nov 11 '15 04:11 jbaum98

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- avatar Feb 18 '16 12:02 lionel-

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

lionel- avatar Feb 18 '16 15:02 lionel-

@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!

jbaum98 avatar Feb 21 '16 00:02 jbaum98

See #35 ;)

lionel- avatar Feb 21 '16 00:02 lionel-

Oh nice! Didn't see that.

jbaum98 avatar Feb 21 '16 00:02 jbaum98