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
This is my own solution i've been using for some time, although i use `jf' actually.
(defun xwl-jj-as-esc ()
(interactive)
(if (memq evil-state '(insert replace))
(let ((changed? (buffer-modified-p)))
(insert "j")
(let* ((tm (current-time))
(ch (read-key)))
(if (and (eq ch ?j)
(< (time-to-seconds (time-since tm)) 0.5))
(save-excursion
(delete-char -1)
(evil-force-normal-state)
(set-buffer-modified-p changed?))
(insert ch))))
(call-interactively 'evil-next-line)))
(define-key evil-insert-state-map "j" 'xwl-jj-as-esc)
(define-key evil-replace-state-map "j" 'xwl-jj-as-esc)