Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [vi-mode] widgets for case manipulation: `gU` and `U` in visual mode

[I'm having some trouble connecting to my SMTP server from home,
so I'm pasting this into gmail.  Apologies if the formatting gets weird or
if a nearly-identical message appears later if things suddenly start
working again.]

On Wed, Jun 22, 2016 at 9:30 PM, Filipe Silva <filipe.silva@xxxxxxxxx> wrote:
> Having an ESCKEYTIMEOUT would be awesome. Setting KEYTIMEOUT to anything
> above 5 is quite noticeable and laggy when I want to return to normal mode.
> KEYTIMEOUT=1 is snappy, but then I lose out on the surround widget and
> whatnot because I can't type `ys` fast enough.

Try this:

    set-keytimeout() {
      case $KEYMAP in
      (vicmd) KEYTIMEOUT=5;;
      (*) KEYTIMEOUT=1;;
    zle -N zle-keymap-select set-keytimeout
    zle -N zle-line-init set-keytimeout

That should give you a short timeout when switching from insert mode
to what you call "normal mode" (command mode), and a longer one when
you are in command mode.  Sadly, for reasons already noted, it won't
speed up using ESC in command mode for deactivate-region.

Messages sorted by: Reverse Date, Date, Thread, Author