Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spacemacs escape key needs delay to work

Tags:

tmux

evil-mode

I have clean install of spacemacs. When I press escape to enter normal mode then immediately press u it will uppercase a word. If I wait a second, it will undo last action.

I'm assuming this is evil-mode or emacs key-chord feature in action. How can I change that behavior?

like image 948
sevo Avatar asked Jun 03 '15 09:06

sevo


2 Answers

Spacemacs, particularly the develop branch should just work right out of box without the delay. However, I have found that this delay happens when I am running emacs inside of tmux. You should see if you are trying to run this inside tmux or screen, and if you are, see if this problem happens when you run emacs directly inside a terminal, without a terminal multiplexer.

If tmux is your problem, you can fix this with:

set -s escape-time 0

You'll have to find the equivalent in screen if that is what is happening.

See: https://bitbucket.org/lyro/evil/issue/69/delay-between-esc-or-c-and-modeswitch

like image 69
Ho-Sheng Hsiao Avatar answered Nov 04 '22 00:11

Ho-Sheng Hsiao


Zeroing out my delay as Ho-Sheng Hsiao suggested has served me well, but as Wesley Baugh pointed out, that has the consequence of preventing the use of ALT-key modifiers in your editors.

The Emacs-evil FAQ addresses the problem, but not very succinctly, and without a concrete recommendation.

The Neovim FAQ has a more succinct explanation, and a specific recommendation:

set-option -sg escape-time 10  # millisecond delay
like image 28
billkw Avatar answered Nov 04 '22 00:11

billkw