1

So, in evil mode, something like d i b (delete inside brackets) is a common occurence. However, describe-key will immediately describe just the d part. Using (describe-key "d i b") produces: d i b is undefined.

How would I view a description of such a keybinding? And how are they called anyway, modal, sequential?

2 Answers 2

1

This is impossible with Evil's current design. Here's roughly what happens for a normal Emacs command:

  • Emacs waits for a complete keybinding
  • You press a key
  • Emacs looks it up in the currently active keymaps
  • It finds a match for a prefix
  • It waits for another key in that prefix map
  • It looks it up again
  • This repeats until a full keybinding has been read
  • Emacs executes the command

With Evil operators things are a bit different:

  • Emacs waits for a complete keybinding
  • You press a key
  • Emacs looks it up in the currently active keymaps
  • It finds a match in Evil's normal state map and executes the operator command
  • The operator command reads in more keys until it has figured out the range
  • You press i which is looked up and found as Evil's inner text objects map
  • You press b which is looked up and found in Evil's inner text objects map
  • The operator command computes the range and does its job

This explains why describe-key is insufficient here, it's done by the point the operator command is executed. If you wanted to do better, you'd need to write a custom command that knows that reading keys is not done after that and use it instead.

0

You can 'describe' the binding by first pressing d, then C-h k followed by i d.

I think these are called sequential bindings. Modal (editing) means that there exist different modes (i.e. in vim, in evil they are states), like normal, insert, visual etc. where every mode can have different bindings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.