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.

wasamasa
  • 21,803
  • 1
  • 65
  • 97
nalzok
  • 665
  • 6
  • 18

1 Answers1

23

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.

wasamasa
  • 21,803
  • 1
  • 65
  • 97