I use Vim, almost exclusively in the console. When I exit insert mode by pressing <ESC>
, there is a noticeable lag in Vim's recognizing the command. The lag is similar to the delay when I push the <leader>
key, I assume to give me time to enter other characters in a mapping. Is there an option I can set to get Vim to recognize the escape key faster?
If you use Vim in a terminal, simply press alt/meta+normal_mode_key. Most terminals send an escape character followed by the normal_mode_key that you pressed, removing the need to press escape yourself. Thus in insert mode pressing alt+h alt+j alt+k alt+l all take you to normal mode and move in the expected direction.
But a simple fix to the issue is by pressing the Shift and Escape keys. When the Esc key is not working, you can try pressing the key combination Shift + Esc to close the app. For instance, you need to press Shift + Esc to open the Task Manager of Chrome instead of Esc.
Short for Escape, Esc is a key found on the top-left corner of a computer keyboard. It allows the user to abort, cancel, or close an operation. For example, if a web page was loading slow on an Internet browser, pressing the Escape key stops the download.
If you are using tmux, that could be introducing a delay. Put this in your ~/.tmux.conf file:
set -s escape-time 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With