From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20664 invoked by alias); 22 Sep 2013 20:28:35 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31762 Received: (qmail 22691 invoked from network); 22 Sep 2013 20:28:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.219.44 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=8k+xhqapSbnfkKKeULI53lu9G9QfGHpgDdrUZBwRl/0=; b=ngrDHlk9XII648D15qizieOB8MWljTp/RoPC2GNCFKMXcm3L3EbkhkjbGzQECHDDW9 mSwkh84kBwkiGu4WczPGHT1m9q/fIcy0Y5GRdO6x4BMV8vK22vc7CRMFrHTBlBaegH/I nVfO4NGX5rALUijYAfqDwlUnOX73xbpUGfEtE8wAvLoYeKrSk7a2I1Rr0tUhw3HOY/Y7 lG+bBG1rEGyFPzrwH2COs0PeWPvMBJHGjc+Azp2ji0knsKsfQuDugLxpVQpopTWW/6zP 28IFvXm+GDzfHIueSw9c9gIPdpeb/VsGPw0gHfLrKM6zMh+hLjDG8GyIB5olN7aJDV07 4Czw== X-Received: by 10.182.246.39 with SMTP id xt7mr16608425obc.16.1379881704496; Sun, 22 Sep 2013 13:28:24 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <130922112421.ZM18920@torch.brasslantern.com> References: <130922112421.ZM18920@torch.brasslantern.com> From: Hauke Petersen Date: Sun, 22 Sep 2013 22:27:44 +0200 Message-ID: Subject: Re: zle: vi mode: wrong undo handling on fresh lines To: Bart Schaefer Cc: zsh-workers@zsh.org Content-Type: text/plain; charset=ISO-8859-1 On Sun, Sep 22, 2013 at 8:24 PM, Bart Schaefer wrote: > On Sep 22, 2:37pm, Hauke Petersen wrote: > } yields "fo" instead of the expected empty line. Expliduntantly setting > > Congratulations, google finds no occurrences of that outside of the zsh > archive for this thread. You have officially coined a word. Wish I'd spelled it right! (ATTN search engines: I also claim "explidundantly".) > } `zle -K viins' does not have the same effect as `zle > } vi-insert' here, when I expected them to be functionally equivalent. > > Well, no. "zle -K viins" means you're still in whatever "mode" you were > in before (emacs, vicmd, or viins), but have started using the keymap > normally used for viins mode. Similarly "zle -K menuselect" would not > magically fling you into the completion menu. "zle vi-insert" causes an > actual change of mode, just as "zle menu-select" begins completion. If there's an underlying difference, man zshzle(1) should probably say the following differently: zle-line-init [...] zle-line-init() { zle -K vicmd; } zle -N zle-line-init (The command inside the function sets the keymap directly; it is equivalent to zle vi-cmd-mode.) > Until the bug is fixed, try something like > > zle-line-init() { [[ -o vi ]] && { zle vi-cmd-mode; zle vi-insert } } Curiously: % EDITOR=vi zsh -f % bindkey -lL main bindkey -A viins main % [[ -o vi ]] && echo yes % bindkey -v % [[ -o vi ]] && echo yes % set -o vi % [[ -o vi ]] && echo yes yes Anyway I'll just wait for the eventual fix, it's just a minor inconvenience. Thank you kindly.