Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: visual/viopp modes are not detected by zle-keymap-select
- X-seq: zsh-users 21313
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: visual/viopp modes are not detected by zle-keymap-select
- Date: Wed, 24 Feb 2016 10:31:10 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=H8UglWTnYHvLc8qWCHszQqCBxCxsl7lSX8nAYYxT+mg=; b=an0S2d6ckedKNUpEqPIxrhf55LSiJ3azrwsNcldW87R/w6B5Q6oC689hRkEzxNUhDD YaQTYCJ0ehmMkqgJYYcxL6Q5zpbD1IiXoqQgdsW1WOIZC73e4eKayWITR9k6Jw6RF6e9 Cv9ig3sJgyVmF3BGr6N+BArkcrUX2gQT09wKGtGcvhXen+/b3OZMYHXwduanatUlfIn3 rjXtvOmvER/2kWWpBX3mVMhSKa4rhQ3SkerIdprBDnSN7H8LKfmKI+N4IJ4PdeSqgLB7 V7yGh5hrI43ej32c3teEAZEf9IF8QF/sFBzegXnwGy4+vL5OIKuL5oG4DcWSD7TVHJwl RZwg==
- In-reply-to: <CABZxu=yWf5hLEmbQiSoFGM6hhNH6TD-E5KTvSPqH_U+=yOmD_Q@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author