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

Re: Multiline prompts and vi editing mode

Ok, I found the problem, though I'm not entirely sure what's going on.

As I said before I was using oh-my-zsh, and I was using a plugin called vi-mode.
At the top of this plugin file were these lines:

function zle-line-input zle-keymap-select {
    zle reset-prompt

zle -N zle-line-init
zle -N zle-keymap-select

bindkey -v

So I remove the plugin from being loaded and do these steps one at a time manually and it turns out
that the 'zle -N zle-keymap-select' line is what is causing my issue.

So now the question is, do I really need these settings?  What do I get by setting these over just
doing a set -o vi?

Thanks again for the assistance,

On 6/1/11 11:27 PM, Michael Grubb wrote:
> On 6/1/11 9:39 PM, Bart Schaefer wrote:
>> On Jun 1,  5:28pm, Michael Grubb wrote:
>> } Subject: Multiline prompts and vi editing mode
>> }
>> } I've also been tinkering with some of the features from oh-my-zsh,
>> } specifically some of the themes that feature multiline prompts. I have
>> } noticed however that when hitting Esc to go into command mode that I'm
>> } loosing the last line of output from the previous command.
>> This probably means that there's something in the prompt that should be
>> wrapped in %{ and %} but is not.  Or it may mean that there's a newline
>> wrapped in %{ and %} that should not be.  Zsh generally deals quite well
>> with multiline prompts.
> Here is what my PROMPT/PS1 variable looks like:
>   PROMPT='%m %~
>   > '
> I stripped out all the extra stuff (colors/etc) to make sure that nothing hinky
> was happening between the %{ %}.  Incidentally, if I do put the newline between
> the %{ and %} I get the opposite problem, I get an extra 'top line' instead of
> it eating a line.
>> } Also in ksh I can use Esc-\ to invoke command completion, though that
>> } doesn't seem to work with zsh, any tips on getting that configured
>> } would also be very much appreciated.
>> I suspect you want
>> bindkey -M viins '\e\\' complete-word
>> but I'm not certain because no ksh to which I have access behaves that
>> way, at least not by default.
> That bindkey did the trick, thanks! You may have to 'set -o vi ; set -o viraw' to get that to work.

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