Thursday, March 25, 2010

Re: Anyone ever had the O command take too long? [sj]

[reversing the top-posting]

On Thu, 25 Mar 2010, smu johnson wrote:

> On Thu, Mar 25, 2010 at 1:44 PM, Benjamin R. Haskell <vim@benizi.com> wrote:
>
> > On Thu, 25 Mar 2010, smu johnson wrote:
> >
> > > Hi,
> > >
> > > This has been happening to me for about 2 years, and I've decided to
> > > do something about it. If I hit the ESC key when I'm in INSERT mode
> > > to get out of it, and quickly hit O to open a new line above where I
> > > was writing, it writes the letter O on the screen, waits about 1.5
> > > seconds, then erases the O and actually executes the O command.
> > >
> > > I'm wondering if anyone else has this problem. This only happens if I
> > > type quickly as I'm escaping from INSERT mode. I checked my .vimrc
> > > file and nothing seems to be mapped to o* or O*, which would likely be
> > > the first place to look.
> >
> > Also look for anything mapped to meta/alt + O. Discussion at:
> >
> > :help :map-alt-keys
> > :help 'esckeys'
> >
> > Gist: alt+[letter] often maps to <ESC> followed by [letter], depending
> > on the terminal, so is handled specially in terminal Vim.
> >
>
> Wow... I didn't even know you could map to Alt keys!
>
> ... unfortunately since I haven't... I don't think Alt key bindings
> come into play here.. :(
>
>

Ah. I get the same behavior, anyway. It's due to what the help text
mentions for 'esckeys': In many terminals, the cursor keys send
sequences that begin with <Esc>. E.g., someone on the list recently had
trouble with ctrl+arrow keys not being recognized. The keys in whatever
terminal it was send:

<Esc>Oa - <C-Up>
<Esc>Ob - <C-Down>
<Esc>Oc - <C-Right>
<Esc>Od - <C-Left>

So, Vim can't tell the difference between '<Esc>' followed by 'O', and
'<C-arrow>'. See a possible workaround at:

:h 'timeout'

--
Best,
Ben

--
You received this message from the "vim_use" 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

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

No comments: