Recently I tried Emacs and found Evil helpful to keep my vim custom. I'm used to typing "jj" to return normal mode from insert mode like many Vimers do but don't know how to make it in Evil mode.
I map it like this but seems not correct:
(define-key evil-insert-state-map (kbd "jj") 'evil-normal-state)
It's a bit more complicated - you have to watch for the previous character. This should do the trick. (the gist is for "jk", you can easily modify it for "jj" though you will note that "jk" is more efficient/faster).
This works for me. It requires the KeyChord library:
It is inspired by @phils answer above and based on Simon's Coding Blog: Emacs and Unity Every Day.
For my windows install, adding as part of use-package evil configuration worked for me in init.el:
For Ubuntu, I followed E. Sambo's answer.
I don't know whether it works with Evil, but for Emacs in general the KeyChord library is designed for this sort of thing.
Try it and see?
If you're using Spacemacs then I just found that this setting (added to the beginning of
user-init
) works very well,(setq-default evil-escape-key-sequence "jj")
This is my own solution i've been using for some time, although i use `jf' actually.