Q: in Emacs, how does one make mode-specific key bindings for text objects in evil
?
One may bind a key in a specific state (normal, insert, etc.) in a specific mode as the following example demonstrates:
(evil-define-key 'normal org-mode "a" 'some-command)
However, it's not clear to me how to bind a key in a mode-specific way to evil-outer-text-objects-map
(or its -inner-
counterpart). As an alternative, it's also not clear how one might bind keys in these maps in a buffer-local way through a mode hook.
It doesn't look like evil-local-set-key
will do it, because it expects a state (normal, insert, etc.) as its first argument, and that's not relevant to this task.
It's also not clear how to use local-set-key
in this instance, because it expects a key and a command as arguments, but does not take a map as an argument.