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

Re: Vi ZLE bindings: status in prompt?



Hello,

Tom Martin wrote:
> Hello,
> 
> The Subject pretty much asks the question. I'd be delighted if there was
> some way to add the Vi mode to the prompt. This is the only thing
> preventing me from using bindkey -v. Any ideas?

I have such a thing implemented. You can have a look at my .zshrc
to see how it works:

http://gott-gehabt.de/800_wer_wir_sind/thomas/Homepage/Computer/zsh/zshrc

In short, it uses the show_mode function to display the mode
(normal or insert) and rewrites all vi widgets to also call
show_mode :) It overwrites some area in my (multi-line) prompt,
see also the screenshot on
http://gott-gehabt.de/800_wer_wir_sind/thomas/Homepage/pics/prompt.png
Doesn't work perfectly, though: for overly long lines, the
display may shift to where you don't want it. Of course, you
could also modify the show_mode function to display the mode in
the RPROMPT, then this problem would go away...

Ciao,
Thomas

-- 
 Thomas Köhler       Email:       jean-luc@xxxxxxxxxxxxxxxxx
     <><             WWW:              http://gott-gehabt.de
                     IRC:                           tkoehler
                     PGP public key available from Homepage!

Attachment: signature.asc
Description: Digital signature



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