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

Add evil-leader/set-local-key

Open lionel- opened this issue 8 years ago • 1 comments

Not as clean as I initially thought, because there is no convention that minor modes should have hooks. So we have to resort to advices to set local keys. Usage example:

  (defun pandoc-local-keys (&rest args)
    (evil-leader/set-local-key
      "ps" 'some-command
      "po" 'other-command))

  (advice-add 'pandoc-mode :after #'pandoc-local-keys)

If someone has a better approach to the problem of minor-mode specific leader keys, please suggest it.

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

Possible alternative: http://endlessparentheses.com/define-context-aware-keys-in-emacs.html

lionel- avatar Mar 07 '16 11:03 lionel-