Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zle: vi mode: wrong undo handling on fresh lines
- X-seq: zsh-workers 31762
- From: Hauke Petersen <hkptrsn@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: zle: vi mode: wrong undo handling on fresh lines
- Date: Sun, 22 Sep 2013 22:27:44 +0200
- Cc: zsh-workers@xxxxxxx
- 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==
- In-reply-to: <130922112421.ZM18920@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CANWLQWsV5i+=3NptAxir6UYCoipFa2Pk+g6D1DDnMnJMVCbDgA@mail.gmail.com> <130922112421.ZM18920@torch.brasslantern.com>
On Sun, Sep 22, 2013 at 8:24 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author