Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Starting replace-string minibuffer in Vi command-mode



On Mar 19, 10:43pm, Peter Stephenson wrote:
}
} (The discussion probably ought to go on zsh-workers.)

Redirected there.

} I tried this and it's very annoying... It seems to me
} read-from-minibuffer looks to the user like a new command line and
} therefore should always start in the "main" keymap, right?

I'd think so, yes.  I'm not sure that's exactly the right thing in this
specific case, but it's closer.
 
} There's no way to do this at the moment

Really?  What's wrong with the following?

    vi-read-from-minibuffer() {
      zle -K viins
      zle read-from-minibuffer
    }
    zle -N vi-read-from-minibuffer

} However, this patch is more consistent with the existing "zle -K"

Why add a -K option after the widget name rather than allow the widget
name to follow the existing -K option and its argument? That is, why do

    zle read-from-minibuffer -K viins

rather than

    zle -K viins read-from-minibuffer

??  Just curious.  It looks like it would be just as easy to call on
through to bin_zle_call() from bin_zle_keymap() as to embed a call to
selectkeymap() in the former.

} Hmmm... making the KEYMAP variable read/write and then making it local
} in read-from-minibuffer would do the same thing.  Maybe that's more
} natural?

No, I think your patch is on the right track.



Messages sorted by: Reverse Date, Date, Thread, Author