How does the evil keymap work in Emacs?

How does the evil keymap work in Emacs?

These keymaps function like ordinary Emacs keymaps and may be modified using the Emacs function define-key: This binds the key w to the command some-function in normal state. The use of kbd is optional for simple key sequences, like this one, but recommended in general. Most of Evil’s bindings are defined in the file evil-maps.el.

What can the evil define key be used for?

The macro evil-define-key can be used to augment existing modes with state bindings, as well as creating packages with custom bindings. For example, the following will create a minor mode foo-mode with normal state bindings for the keys w and e:

Where are the default bindings stored in evil?

Each state has a global keymap, where the default bindings for that state are stored. They are named evil-normal-state-map , evil-insert-state-map, and so on. The bindings in these maps are visible in all buffers currently in the corresponding state.

What are the names of the evil maps?

These maps are most suitably modified by a mode hook. They are named evil-normal-state-local-map, evil-insert-state-local-map, and so on. For convenience, the functions evil-global-set-key and evil-local-set-key are available for setting global and local state keys.

How to add state bindings to a keymap?

Evil provides the macro evil-define-key for adding state bindings to ordinary keymaps. It is quite powerful, and is the preferred method for fine-tuning bindings to activate in specific circumstances. Create a STATE binding from KEY to DEF for KEYMAP .

Are there any evil bindings for Emacs calendar?

This is a collection of Evil bindings for the parts of Emacs that Evil does not cover properly by default, such as help-mode, M-x calendar, Eshell and more. Warning: Expect some default bindings to change in the future.

Is there a way to force Emacs to do something?

Forcing this behaviour in Emacs is the source of some potentially surprising results (especially for traditional Emacs users—users used to Vim may find the default behavior to their satisfaction). Many of them can be tweaked using the following variables. Whether repeating commands with . may move the cursor.

Is there a prefix key for F1 in Emacs?

In Emacs, it is a prefix key for all help-related commands, and so is . Most importantly, C-h is too widespread and ubiquitous to be replaced. So we don’t. C-l: As a consequence of the former point, C-l is available.