29

私はほぼコンソールで Vim を使用しています。を押して挿入モードを終了する<ESC>と、Vim がコマンドを認識するのに顕著な遅延が生じます。遅延は、キーを押したときの遅延に似てい<leader>ます。マッピングで他の文字を入力する時間を与えると思います。Vimにエスケープキーをより速く認識させるために設定できるオプションはありますか?

4

6 に答える 6

44

tmux を使用している場合、遅延が発生する可能性があります。これを ~/.tmux.conf ファイルに入れます:

set -s escape-time 0
于 2015-11-19T19:19:38.893 に答える
5

https://stackoverflow.com/a/10856095/157237から露骨にコピーします。

:help 'timeout'おそらく、それに応じて設定を確認して調整することをお勧めします。timeoutlen必要に応じて短い期間に設定できます (ttimeoutlenはデフォルトで に設定されて-1いるため、使用されません)。

于 2012-10-22T23:05:03.993 に答える
2

挿入モードを終了すると、実行が遅いアクションが発生する可能性があります。

CTRL-Cで挿入モードを終了するか、を使用して確認できます:au InsertLeave


編集:

:iabとで完了するのを待っているマッピングまたは略語があるかどうかを確認することもできます:imap

于 2012-10-23T18:18:01.350 に答える
0

set noesckeys

エスケープを助ける:

'esckeys' 'ek'      boolean (Vim default: on, Vi default: off)
                    global
                    {not in Vi}

    Function keys that start with an <Esc> are recognized in Insert
    mode.  When this option is off, the cursor and function keys cannot be
    used in Insert mode if they start with an <Esc>.  The advantage of
    this is that the single <Esc> is recognized immediately, instead of
    after one second.  Instead of resetting this option, you might want to
    try changing the values for 'timeoutlen' and 'ttimeoutlen'.  Note that
    when 'esckeys' is off, you can still map anything, but the cursor keys
    won't work by default.
    NOTE: This option is set to the Vi default value when 'compatible' is
    set and to the Vim default value when 'compatible' is reset.
于 2019-02-24T14:50:20.967 に答える