[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim-dev
Subject:    Re: Delay when Insert mode is left
From:       Jens Paulus <jpaulus () freenet ! de>
Date:       2004-12-30 13:18:54
Message-ID: 20041230131854.GA13408 () ee ! ethz ! ch
[Download RAW message or body]

Hi Bram,

On Thu, Dec 30, 2004 at 11:26:14 +0100, Bram Moolenaar wrote:
> > what I do not understand is why the ruler cursor position gets updated
> > after a timeoutlen delay when leaving Insert mode in vim but in gvim it
> > there is no such delay. The same is also when for example doing
> > 4iabcd<Esc> and the repeated text is inserted after this delay. In gvim
> > there are the same settings for timeoutlen, timeout, ttimeout but it
> > happens immediately. Starting vim with -u NONE or setting it to
> > nocompatible makes it work immediately and without delay. But with same
> > settings gvim has no delay but vim has this delay.
> 
> The reason is that in a terminal there are key codes that start with
> Esc.  When Vim receives an Esc in Insert mode it can't be sure if it is
> the Esc key or the start of a key code (e.g., for a cursor key).  Vim
> then pretents to go out of Insert mode, but only really does so after
> 'ttimeoutlen'.
> 
> You can fix this by using a terminal that uses CSI for special keys.

maybe you can provide me with some suggestions for such terminals. Now I
tried the following mapping
imap <Esc> <C-C>
and the result is that there is no delay anymore and it happens
immediately. The disadvantage of this is that an abbreviation is not
expanded anymore when leaving Insert mode and pressing the cursor keys
is just like if the mappings
ino <Up> <CR><Up>A
ino <Down> <CR><Up>B
ino <Right> <CR><Up>C
ino <Left> <CR><Up>D
were active.

Best regards

Jens


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic