zsh-workers
 help / color / mirror / code / Atom feed
From: Hauke Petersen <hkptrsn@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@zsh.org
Subject: Re: zle: vi mode: wrong undo handling on fresh lines
Date: Sun, 22 Sep 2013 22:27:44 +0200	[thread overview]
Message-ID: <CANWLQWtsh6RTXSctg0hEyTxRHv7bngGeaOf6Cqxufm048br8iQ@mail.gmail.com> (raw)
In-Reply-To: <130922112421.ZM18920@torch.brasslantern.com>

On Sun, Sep 22, 2013 at 8:24 PM, Bart Schaefer
<schaefer@brasslantern.com> 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.


  reply	other threads:[~2013-09-22 20:28 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-22 12:37 Hauke Petersen
2013-09-22 18:24 ` Bart Schaefer
2013-09-22 20:27   ` Hauke Petersen [this message]
2013-09-23  4:57     ` Bart Schaefer
2013-09-23 20:30 ` Peter Stephenson
2014-01-24 23:19   ` Oliver Kiddle
2014-01-25 19:15     ` Bart Schaefer
2014-01-27 12:43       ` Peter Stephenson
2014-01-27 16:11         ` Peter Stephenson
2014-01-28 14:58           ` Peter Stephenson
2014-01-28 16:28             ` Bart Schaefer
2014-01-28 16:47               ` Peter Stephenson
2014-01-28 17:41                 ` Bart Schaefer
2014-01-28 23:00           ` Oliver Kiddle
2014-01-29  2:59             ` Bart Schaefer
2014-01-29 10:50               ` Oliver Kiddle
2014-01-29 14:48                 ` Bart Schaefer
2014-01-30 14:51             ` Jun T.
2014-01-30 15:38               ` Peter Stephenson
2014-01-30 16:03                 ` Bart Schaefer
2014-01-31 12:00               ` Jun T.
2014-01-31 15:19                 ` Bart Schaefer
2014-01-31 15:33                   ` Peter Stephenson
     [not found]               ` <16181.1391175951@thecus.kiddle.eu>
2014-01-31 16:43                 ` Jun T.
2014-01-31 21:37               ` Oliver Kiddle
2014-01-31 22:32                 ` Oliver Kiddle
2014-02-01 19:27                   ` Bart Schaefer
2014-02-03 16:20                   ` Jun T.
2014-02-03 21:29                     ` Oliver Kiddle
2014-02-03 22:20                       ` Bart Schaefer
2014-02-03 23:26                         ` Oliver Kiddle
2014-02-04 17:11                           ` Jun T.
2014-02-05 22:00                             ` Oliver Kiddle
2014-02-02 22:10             ` Oliver Kiddle
2014-02-07 14:43             ` Oliver Kiddle
2014-02-07 16:22               ` Bart Schaefer
2014-01-27 16:29         ` 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=CANWLQWtsh6RTXSctg0hEyTxRHv7bngGeaOf6Cqxufm048br8iQ@mail.gmail.com \
    --to=hkptrsn@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@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).