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

Re: Multiline prompts and vi editing mode




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