Hi.
On 12/3/06, Bob Rossi <[EMAIL PROTECTED]> wrote:
On Sun, Dec 03, 2006 at 12:06:03PM +0100, A.J.Mechelynck wrote:
> Bob Rossi wrote:
> >Hi,
> >
> >I'm using vim, and I have the default timeout, ttimeout, timeoutlen,
> >ttimeoutlen options set. That is, timeout is on, ttimeout is off.
> >The manual says:
> > 'timeout' 'ttimeout' action
> > on on or off time out on :mappings and key codes
> >So, this to me means that both mappings and key codes will be timed out.
> >
> >My timeoutlen is 1000 and my ttimeoutlen is -1. The manual says:
> > ttimeoutlen mapping delay key code delay
> > < 0 'timeoutlen' 'timeoutlen'
> > >= 0 'timeoutlen' 'ttimeoutlen'
> >This tells me that both the mapping delay and the keycode delay will use
> >1000 milliseconds as a timeout. This is 1 second. However, when I'm in
> >insert mode, and hit the ESC key, vim immediately gets out of insert
> >mode.
> >
> >My question is, how does vim know how to move out of insert mode
> >immediately, since it should be waiting 1 second to determine if the
> >ESC it received was actually an ESC or a key sequence (Home, F1, ...)?
> >
> >Thanks,
> >Bob Rossi
> >
>
> In gvim, and with some terminals in Console Vim, special key codes don't
> start with Esc ; in that case there is no ambiguity. Other than that, I
> don't know, but... "if 't ain' broke, don' fix it."
My terminal definatly starts special key codes with ESC, and there is a
lot of them. Here is a small sample,
$ infocmp xterm
# Reconstructed via infocmp from file: /lib/terminfo/x/xterm
xterm|X11 terminal emulator,
kf4=\EOS, kf40=\EO6S, kf41=\E[15;6~, kf42=\E[17;6~,
khome=\EOH, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~,
I'd really like to know the answer to this question. I have a feeling
vim is not honoring the timeoutlen value that it has documented or that
I don't know how to read the documentation.
I think, the following help topics may be relevant here:
:help xterm-8bit
:help 'esckeys'
:help gui-extras
- Yegappan