Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get Vim to recognize ESC key faster?

Tags:

vim

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?

like image 365
Lincoln Mullen Avatar asked Oct 22 '12 23:10

Lincoln Mullen


People also ask

How do I remap Escape key Vim?

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.

Why is my Esc button not working?

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.

What happens when the Esc key is pressed?

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.


1 Answers

If you are using tmux, that could be introducing a delay. Put this in your ~/.tmux.conf file:

set -s escape-time 0 
like image 100
allenwoot Avatar answered Sep 19 '22 01:09

allenwoot