On 16/07/08 08:43, François Ingelrest wrote:
> On Wed, Jul 16, 2008 at 01:10, Ian Kelling<[EMAIL PROTECTED]> wrote:
>> For 4, you can do something similar, like :inoremap<ESC> <ESC>l
>
> I've been using something like that for some time:
>
> inoremap<Esc> <Right><Esc>
>
> This works in GVim but breaks extended keys in Vim (they send<Esc> as
> the first keycode).
>
> It seems that Vim doesn't wait a bit to see if another keycode
> follows, but rather immediately applies the mapping. This does not
> happen without the mapping, because in this case Vim correctly waits a
> bit to see whether it's<Esc> or an extended keycode. Not sure whether
> this a bug or something desirable though...
IIUC it is usually a side-effect of 'ttimeoutlen' being at its default
of -1 (wait just as long for keycodes as for mappings). With something like
set timeout ttimeoutlen=100 timeoutlen=5000
keycodes will timeout after one-tenth of a second (fast for a human, but
usually quite lazy for a keyboard driver or a telecom line) while
mappings will only timeout after five seconds (which should be ample for
a human typist). Then if <Esc> is followed by something within one-tenth
of a second it is examined for a keycode, but after that it still counts
for a mapping.
If it still doesn't work, add
inoremap <Esc><Esc> <Esc>
to force the full timeout (5s in my example) on the Esc key when not
part of a keycode.
Best regards,
Tony.
--
Never commit yourself! Let someone else commit you.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---