Sorry I f*cked the mime types up. here is my message again: Hi, I'm using this function to exit insert state with jk (use `(define-key evil-insert-state-map (cofi/maybe-exit ?j ?k))') #+begin_src emacs-lisp (defun cofi/maybe-exit (entry-char exit-char) "Return a a function that maybe inserts or calls `evil-normal-state'. Insert `ENTRY-CHAR', if it is followed by a `EXIT-CHAR' in the next half second, delete `ENTRY-CHAR' and call `evil-normal-state''." `(lambda () (interactive) (let ((modified (buffer-modified-p))) (insert ,entry-char) (let ((evt (read-event (format "Insert %c to exit insert state" ,exit-char) nil 0.5))) (cond ((null evt) (message "")) ((and (integerp evt) (char-equal evt ,exit-char)) (delete-char -1) (set-buffer-modified-p modified) (evil-normal-state)) (t (setq unread-command-events (append unread-command-events (list evt))))))))) #+end_src emacs-lisp It works fine except for repeating insertions. I tried to modify `evil-repeat-keys' before calling `evil-normal-state' — something along the lines of (setq evil-repeat-keys (append (butlast evil-repeat-keys) [escape])) — but it didn't work and was greeted a `characterp' error. I also tried to access the `evil-repeat-ring' after the call to `evil-normal-state' but it was still empty. So please help me out here: How can I modify the repeat keys correctly? Thanks, Michael