On 2017-02-20, Christian Zangl wrote:
> When I press <Esc> in insert mode I have a delay of about a second before Vim
> switches to normal mode.
> 
> After setting timeoutlen=0 the switch is instantaneous (also if I run vim in
> compatible mode). While the help for timeoutlen and ttimeoutlen does not
> mention escape, shouldn't ttimeoutlen be used for detecting escape? What is 
> the
> reason for the delay?
> 
> I was able to find a work around for insert mode (not sure about the side
> effects):
> 
> augroup FastEscape
>   autocmd!
>   au InsertEnter * set timeoutlen=0
>   au InsertLeave * set timeoutlen=1000
> augroup END
> 
> Is there a better way and can I eliminate the delay in visual mode as well?
> 
> (Tested with Vim 8.0.329 on Linux/Mac with/without tmux)

I suspect that you are seeing the effect of an insert-mode mapping
that begins with <Esc>.  Vim is waiting 'timeoutlen' for another key
to be typed to know whether the command is the mapping or just
<Esc>.  You could check this by executing

    :verbose imap <Esc>

If that's the case, then I would try to change that mapping to use
something other than <Esc> as the leader.

I've seen that a few times recently myself, but I haven't tried to
track it down, and now, of course, I can't reproduce it.

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui