zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: alx741@riseup.net
Cc: zsh-users@zsh.org
Subject: Re: Vimode problem (key press dropping)
Date: Wed, 29 Jul 2015 11:26:05 +0200	[thread overview]
Message-ID: <9361.1438161965@thecus.kiddle.eu> (raw)
In-Reply-To: <5d9984411ba10dee4321a408e2763317@riseup.net>

alx741@riseup.net wrote:
> 
> When i hit ESC two times the next letter is ignored, so in order to 
> enter insert mode i need to hit 'i'/'a' two times two. This is the same 
> for any even number of ESC, the problem is the same for 4 hits but no 
> for 3 times so i can say the second ESC hit leave the shell listening 
> and it just drop the next key press.

The problem is that from vi command mode, the escape key is not bound to
anything. If you bind escape to do absolutely nothing, the problem goes
away.

  bindkey -as '\e' ''

Or alternatively, the following is what vim does:

  bindkey -a '\e' beep

Part of the reason behind the behaviour you see is that the cursor keys
typically are bound and when you press the cursor keys, what zsh sees is
an "escape sequence": a series of characters that start with an escape
character. This also means that after seeing an escape character, zsh
has to wait to see if more characters arrive. You might also want to
tweak the KEYTIMEOUT variable to reduce this delay.

Question to -workers subscribers: how should we address this in the
defaults? I also have escape bound to set REGION_ACTIVE=0 from the
visual keymap which should perhaps also be default behaviour (vim does
that). Note that escape being a prefix character is what causes the
subsequent 'i'/'a' to be ignored.

Oliver


  reply	other threads:[~2015-07-29  9:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29  5:17 alx741
2015-07-29  9:26 ` Oliver Kiddle [this message]
2015-07-29 12:35   ` Mikael Magnusson
2015-07-29 15:30     ` Bart Schaefer
2015-07-29 15:35       ` Mikael Magnusson
2015-07-29 15:51         ` Bart Schaefer
2015-07-29 16:31           ` Mikael Magnusson
2015-07-29 16:45         ` Oliver Kiddle
2015-07-29 17:49           ` Bart Schaefer
2015-07-29 17:53             ` Bart Schaefer
2015-07-29 18:32   ` alx741

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9361.1438161965@thecus.kiddle.eu \
    --to=okiddle@yahoo.co.uk \
    --cc=alx741@riseup.net \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).