Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tmux and Vim: Escape key being seen as ^[ and having long delay

Tags:

In MacVim and terminal Vim, everything works fine and I have no problems. As soon as I jump into tmux and run Vim there, the escape key starts having a delay of about 1 second and shows up in Vim as ^[.

I'll hit the escape key to exit insert mode but around a 1 second delay will happen before Vim reacts and takes me back to normal mode.

If I type Ctrl+o to get temporarily to insert mode it immediately pops into normal mode with no delay.

If I type jj to get to normal mode (a shortcut I set) it still takes around a second. This leads me to think that the problem may be with Vim and not tmux

I've already set set -sg escape-time 0 in my tmux.conf but it hasn't helped at all.

Any ideas?

like image 567
Dustin Martin Avatar asked Sep 07 '12 05:09

Dustin Martin


1 Answers

See https://unix.stackexchange.com/questions/23138/esc-key-causes-a-small-delay-in-terminal-due-to-its-alt-behavior.

The issue is with a tmux escape delay. The tmux setting below should correct it:

set -s escape-time 0

like image 111
Puhlze Avatar answered Nov 04 '22 19:11

Puhlze