zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: visual/viopp modes are not detected by zle-keymap-select
Date: Wed, 24 Feb 2016 10:31:10 -0800	[thread overview]
Message-ID: <160224103110.ZM28059@torch.brasslantern.com> (raw)
In-Reply-To: <CABZxu=yWf5hLEmbQiSoFGM6hhNH6TD-E5KTvSPqH_U+=yOmD_Q@mail.gmail.com>

On Feb 23, 11:34pm, Hugh X wrote:
}
} The recent zsh 5.2 supports more vi modes including visual and viopp. When
} I switched from vicmd to visual, the zle-keymap-select fails to capture the
} keymap change in $KEYMAP. Please let me know if there is a way to indicate
} the current editor state enters the visual-mode. Thanks.

The zle-keymap-select hook is not called for "local" keymaps, which for
the most part means those that are active within the context of another
built-in widget invoked from one of the other keymaps.  Local keymaps
currently include:

command - inside execute-named-command
isearch - incremental search
listscroll - in completion lists
menuselect - in menu selection
viopp - reading bounds of vi range operator
visual - active region in vicmd

The reason for this is that local keymaps generally each have a special
interpreter for the widget bindings, and can't be allowed to branch off
to arbitrary user-defined widgets (including the hooks).

However, it looks to me as though visual mode could potentially be an
exception to this.  It uses the local map to look up the binding, but
then restores the vicmd map before invoking the widget.  On the one
hand, this means we *could* invoke zle-keymap-select (twice); on the
other hand, it means the mode is NEVER "visual" in any *other* context
where it might matter, except for updating the prompt.

I'm personally not a vim user so I have no idea how this corresponds to
actual vim behavior.  It'd also help to understand how you intend to
make use of the $KEYMAP value.


  reply	other threads:[~2016-02-24 18:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24  4:34 Hugh X
2016-02-24 18:31 ` Bart Schaefer [this message]
2016-02-24 21:59 Hugh X
2016-02-29 23:30 ` Bart Schaefer

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=160224103110.ZM28059@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --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).