From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18081 invoked by alias); 24 Feb 2016 18:31:18 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21313 Received: (qmail 4602 invoked from network); 24 Feb 2016 18:31:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=H8UglWTnYHvLc8qWCHszQqCBxCxsl7lSX8nAYYxT+mg=; b=ayFqw6XvSQAzQnotOvaj+W+HapFHoSB57Bup6nLnqUnt/lDGE43qev2tynbxwX4AkJ +b698oImjwyxuxKEU4HHXttZXRTyQ+PlixB3wYvPD1JN1PRsEF/KZ/FFuvVY8s0QmwjO zGt2IPU+NsDQqXXbQ9Kh8tlQoSMKALUNddRgk4UZhddXux7MyLbJ1BYFizwQSHB8zxml TLblv4QY73xJW83Hu+W882uZU/GT6yVvYKVYsva3/0WM2h4wRxr18fqIgS6cFetA5tAm l1COBIy5JgMOKurCnFYE9oTrJAqT7CwU6xfQ6LBoyE9MH70BxCr3VnElDip+TBVGp43U arVQ== X-Gm-Message-State: AG10YOSvo79qQOljqIkjN5H9k1qt1qjKK0CDa7T5Uf/MInfEqfUN2pzsYWdAIRnmSCu2aw== X-Received: by 10.67.14.138 with SMTP id fg10mr57030221pad.145.1456338670313; Wed, 24 Feb 2016 10:31:10 -0800 (PST) From: Bart Schaefer Message-Id: <160224103110.ZM28059@torch.brasslantern.com> Date: Wed, 24 Feb 2016 10:31:10 -0800 In-Reply-To: Comments: In reply to Hugh X "visual/viopp modes are not detected by zle-keymap-select" (Feb 23, 11:34pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: visual/viopp modes are not detected by zle-keymap-select MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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.