Solution for meta/escape in terminal mode

Frank Fischer frank.fischer at mathematik.tu-chemnitz.de
Wed Apr 25 08:40:40 CEST 2012


On Tue, Apr 24, 2012 at 04:08:58PM -0700, Jason Miller wrote:
> I really like evil under X, but find it nearly unusable in a terminal
> due to escape/meta clashing in insert mode.  I currently use exactly one
> meta keybinding in insert mode (M-Tab) and hardly ever press tab in
> normal mode, so ideally I'd like to supress all meta bindings except
> M-Tab while in insert mode.

M- keybindings are usually placed in a keymap under the ESC prefix
key, so you could, e.g., replace the binding on ESC by some direct
command:

(define-key evil-insert-state-map (kbd "ESC") #'evil-force-normal-state)

But this would disable M-TAB as well. There is, afaik, no easy way to
get both because you can only have either the direct command bound to
ESC or the prefix-map.

But I think I do not understand your problem. What *exactly* does not
work as you expect? Evil tries to deal with escape/meta in terminal
mode (by doing some magic with a command bound to ESC which sometimes
behaves like a prefix-map) and it should work in almost all cases. If
it does not work we would like to know the exact situation when this
happens.

And for problems with terminal mode it is important to know which
terminal you use and if you use a terminal multiplexer like screen or
tmux.

Frank



More information about the implementations-list mailing list