To make global keybindings in emacs without evil, one would normally use global-set-key . global-set-key is just a small wrapper function around define-key that defines a key in the current global map and signals a error when the key isn't a string or vector. As an evil user, you won't often use this function since evil provides several of its own global keymaps corresponding to vim modes. They are as follows:

evil-insert-state-map

evil-emacs-state-map

evil-normal-state-map

evil-visual-state-map

evil-motion-state-map

evil-operator-state-map

evil-outer-text-objects-map

evil-inner-text-objects-map

evil-replace-state-map

There are also buffer local versions of these (e.g. evil-normal-state-local-map ).

Most of these should be self-explanatory coming from vim. Emacs state is similar to insert state but uses emacs keybindings (e.g. C-n is bound to next-line instead of to evil-complete-next ). For the most part, the keys are the same as if you weren't using evil at all in emacs state (apart from evil-toggle-key which enters/exits emacs state, C-z by default).

Motion state is a bit strange. Keys bound in motion state are inherited in the normal, visual, and operator state keymaps if they are not shadowed. The same inheritance rules apply to normal state, and the main reason motion state exists is for use with read-only modes where insertion keybindings aren't useful. For example, motion state is the default state for help-mode . This means that, by default, only keys bound in motion state will work in help-mode .

I personally think that the existence of motion state is a bad idea since it often confuses beginners as there is no vim equivalent and its purpose may not be immediately clear, has a misleading name (it isn't only used for motions), addresses what I consider a non-issue (e.g. accidentally pressing i in a read-only buffer), and addresses this issue poorly. For example, motion state isn't suitable for all read-only modes (e.g. motions don't make sense in ediff-mode ), and remapping insertion commands to be ignored (which is what evil-collection now does) is a more foolproof and unobtrusive alternative to creating new states. That said, as long as you remember that evil binds motions and some other commands in motion state by default and are aware of evil-motion-state-modes and evil-set-initial-state (see Make Evil Normal State the Initial State Always for information on using normal state instead of motion state in all modes), you shouldn't encounter any issues.

If you are ever want to know what state a key is bound in, you can check evil-maps.el or use lookup-key . For example, evil-next-visual-line is bound to gj in motion state instead of in the normal state keymap (you can check this with (lookup-key evil-normal-state-map "gj") which will return nil ). Similarly, if you look up the operator keys such as d , you will find that they are only explicitly bound in normal state and not in visual state. Generally, keys are only bound directly in visual state when they have a different behavior from the normal state keys (e.g. u and U for altering case).

Also note that defining a key in evil-visual-state-map is more like xmap in vim since there is no "select" state in evil.

These are the other evil keymaps that might be useful:

evil-ex-search-keymap ( / and ? )

( and ) evil-ex-completion-map ( : )

( ) evil-command-window-mode-map ( q: ; you'd use evil-define-key for this)

( ; you'd use for this) evil-window-map (a prefix map for the C-w keys)

Since define-key is the basis for key definition in emacs, I will begin by explaining it. The basic format of define-key is (define-key <keymap> <key> <definition>) . The specified key can be a string (or something that evaluates to a string) or a vector. You probably won't want to use a vector of characters instead of a string, but you can use a vector to remap a command, for example. The definition will normally be a command (or something that evaluates to one), but it can also be a keymap or a string. A key bound to a keymap is a prefix key. Binding a key to a string will cause emacs to execute that string as a keyboard macro (see Binding Keys to Keys (Keyboard Macros) for examples). See the help text for define-key (e.g. C-h f define-key RET ) for more information on valid definitions.

Here is what a basic nmap command equivalent would look like in emacs:

( define-key evil-normal-state-map "j" 'evil-next-visual-line ) ( define-key evil-normal-state-map "k" 'evil-previous-visual-line ) ;; with ` evil-define-key ' ( evil-define-key nil evil-normal-state-map "j" 'evil-next-visual-line "k" 'evil-previous-visual-line ) ;; with general.el ( general-nmap "j" 'evil-next-visual-line "k" 'evil-previous-visual-line )

Evil also provides a convenience function called evil-global-set-key that allows you to simply specify the name of the state as opposed to the full keymap name:

( evil-global-set-key 'motion "j" 'evil-next-visual-line ) ( evil-global-set-key 'motion "k" 'evil-previous-visual-line ) ;; ` evil-define-key ' can also used with "global" ( evil-define-key 'motion 'global "j" 'evil-next-visual-line "k" 'evil-previous-visual-line )

Remember that binding a key in motion state is like binding a key in the normal, visual, and operator states all at once (unless that key is already bound in one of those states).

You can write the key portion as just a string, but often people will use kbd to conveniently write keys that have special characters in them like control and space. This follows the format mentioned in Key Notation. These are equivalent: