general.el icon indicating copy to clipboard operation
general.el copied to clipboard

Unable to bind key with prefix in a specific major mode

Open jdormit opened this issue 6 years ago • 1 comments

Hi, I've been banging away at this for a while and haven't made any progress. I want to to bind a key behind a prefix in the normal, motion, and visual evil states only in a specific major mode. For example:

(general-def :prefix "SPC" :states '(normal visual motion) :keymaps 'org-mode-map ">" 'test)

However, when I evaluate this, SPC > gets bound to the test command globally, not just in org-mode. What am I doing wrong here?

jdormit avatar Dec 06 '19 19:12 jdormit

I cannot replicate this behavior. Are you on the latest version of general.el? I'll double check to make sure I don't have any local changes or configuration that would cause this.

Also, if you are using general-def already, you can use this syntax if you want:

(general-def '(normal visual motion) org-mode-map
  :prefix "SPC"
  ">" 'test)

noctuid avatar Dec 07 '19 16:12 noctuid