19

Documentation for evil-normal-state-map:

Keymap for Normal state.

Documentation for evil-motion-state-map:

Keymap for Motion state.

Does Vim have a so-called "motion mode"? In Vim, executing :help Normal-mode would give you the documentation on Vim modes, while :help Motion-mode tells me E149: Sorry, no help for Motion-mode.

Also, when mapping keys in evil-state, which statement should I use?

  • (define-key evil-normal-state-map (kbd <key>) <command>)
  • (define-key evil-motion-state-map (kbd <key>) <command>)

I'm using Spacemace, in case it's relevant.

1 Answer 1

24

Motion state is an Evil-specific thing, intended for modes where you don't edit text, but still want Vim-style movement available, with all other keys of that mode passing through. Help buffers are an example of such a case, the package.el listing is another one.

Typically you want commands moving point in evil-motion-state-map and everything else in evil-normal-state-map. As Evil is set up to look up keys in evil-normal-state-map first, then in evil-motion-state-map, movements will be available in normal state as well.

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.