Possible to bind ESC to a command under motion state?

Frank Fischer frank-fischer at shadow-soft.de
Thu Jun 9 09:15:21 CEST 2016


Try [escape] instead of ESC:

(define-key evil-motion-state-map [escape] 'foo)

On 08.06.2016 17:46, Shiyao Ma wrote:
> Hi,
> 
> I am under _terminal_ emacs.
> 
> 
> I'd like to bind <esc> to a command(actually evil-motion-state) when I
> am under evil motion state, while keeping other binding, namely, M-0 usable.
> 
> Since M-0 sends ^[0 while "esc" simply sends ^[, that's the problem here.
> 
> I'd guess the method is the same as how "esc" binding is done under the
> normal state, e.g., use a time limit to test whether it's a "esc" or
> it's a M-0.
> 
> 
> Why I need this?
> It's because, for example, when I do a "c-h c-c c-c", I am dropped into
> the help window.
> It's in the motion state.
> 
> I've been in the habit of unconsciously hitting the <esc> key.
> 
> 
> 
> 
> -- 
> 
> 吾輩は猫である。ホームーページはhttps://introo.me <http://introo.me>。
> 
> 
> _______________________________________________
> implementations-list mailing list
> implementations-list at lists.ourproject.org
> https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
> 




More information about the implementations-list mailing list