質問: どのようにエスケープキーの邪悪な挿入状態バインドを元に戻すには? エスケープキーが届きにくいので、私は `Co` にEvil Insertモードの `ESC` にバインドされた `evil-normal-state` 私のキーボードは `Co` と打ってください。ここでは、代わりに `ESC` キーの元の意味をプレフィックスキーとして使用したいと考えています。 私は試した: ``` (define-key evil-insert-state-map (kbd "ESC") 'ESC-prefix) ``` それは動作しません。
回答: `ESC` is the escape character, is the symbol generated by pressing the ESC key **in X**. The escape character is generated when pressing something key together with the meta-key like `M-x`, that actually generates two key events, first the ESC event, second the `x`. (actually, that's only true in terminal mode since in X `M-x` generates a special event, but this event is mapped to `ESC x`). The problem is that in terminal mode the escape key does not generate but also `ESC`. That said, in order to have the escape key working correctly in terminal, Evil has to catch the ESC event and possibly translate it to after some timeout (otherwise either bindings like `M-x` or leaving insert state with `ESC` would not work). In other words, the event `ESC` typically never reaches those keymaps because it is translated to before. The variable `evil-intercept-esc` can be used to customize this behavior (but only in newly created frames).