In vim one can escape normal mode by pressing Alt or Meta then pretty much any key, e.g. Met-j to escape insert mode and move down a line. Holding alt before typing would send an <Esc> key before the command.

I found it was the fastest was of escaping normal mode and has become muscle memory. I have been researching how to do this with evil mode, but haven't figured it out as there is lots of documentation about how to make evil mode quit various emacs states.


This trick is a side effect of how terminal emulators work, key combinations with meta are implemented as sending an escape key followed by the letter (unless your terminal emulator is configured to do something else like inserting an accented letter), if you try this trick in gvim, you'll notice it isn't supported there.

Emacs chose to interpret the escape key followed by a letter as an alternative way of typing the meta modifier, in order to support a greater amount of keybindings. This behavior is pretty much hardcoded and cannot be easily worked around. Instead Evil provides \ in normal state to temporarily switch to Emacs state and C-o in insert state to temporarily switch to normal state.

  • I used to use it in normal Vim and NeoVim-Qt. The reason I am trying out Emacs is because it apparently so much more configurable. The first thing I try to config I get the answer of its not possible. Hmmm. Mar 16 '20 at 17:56

Ended up doing the following: ALT+arrows or ALT+: enters normal mode. ALT+: also asks for execute command:

(defun evil-normal-state-then-ex ()
"Run 'evil-normal-state' and 'evil-ex' in sequence."

(define-key evil-insert-state-map (kbd "M-h") 'evil-normal-state)
(define-key evil-insert-state-map (kbd "M-j") 'evil-normal-state)
(define-key evil-insert-state-map (kbd "M-k") 'evil-normal-state)
(define-key evil-insert-state-map (kbd "M-l") 'evil-normal-state)
(define-key evil-insert-state-map (kbd "M-:") 'evil-normal-state-then-ex)
  • That doesn't move the cursor after switching to normal state though or does it?
    – wasamasa
    Mar 9 '20 at 19:28
  • Yes it does move the cursor, and M-: will enter into command mode. Often the next thing I wish to do is move or enter a command after leaving insert mode. Unfortunately things like M-w dont work unless I map out pages of every combination or movement commands. Mar 10 '20 at 13:09

You can install the package evil-escape from MELPA. It does what you need.

  • From what I understand the package define more state to escape from. The trouble I am having is how to define the the key combo M-???? to be <esc> then ????? when in insert mode. Mar 4 '20 at 15:51
  • No, it doesn't. The package is designed to give you an alternative way of exiting insert mode, whereas this is about temporarily suspending insert state.
    – wasamasa
    Mar 4 '20 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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