zsh-users
 help / color / mirror / code / Atom feed
* Vi ZLE bindings: status in prompt?
@ 2005-04-20 21:47 Tom Martin
  2005-04-21  5:24 ` Thomas Köhler
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Martin @ 2005-04-20 21:47 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]

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?

Thanks in advance,
Tom

-- 
Tom Martin, http://dev.gentoo.org/~slarti

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Vi ZLE bindings: status in prompt?
  2005-04-20 21:47 Vi ZLE bindings: status in prompt? Tom Martin
@ 2005-04-21  5:24 ` Thomas Köhler
  2005-04-21  7:26   ` Bart Schaefer
  2005-04-21 16:09   ` Tom Martin
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Köhler @ 2005-04-21  5:24 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

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@picard.franken.de
     <><             WWW:              http://gott-gehabt.de
                     IRC:                           tkoehler
                     PGP public key available from Homepage!

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Vi ZLE bindings: status in prompt?
  2005-04-21  5:24 ` Thomas Köhler
@ 2005-04-21  7:26   ` Bart Schaefer
  2005-04-21 16:09   ` Tom Martin
  1 sibling, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2005-04-21  7:26 UTC (permalink / raw)
  To: zsh-users

On Apr 21,  7:24am, Thomas Köhler wrote:
}
} > some way to add the Vi mode to the prompt.
} 
} 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

That relies on being able to reposition the cursor to where the prompt
was last drawn, and write something new over it, without the real prompt
being reprinted.  Which is clever, if not entirely reliable.

In recent CVS snapshots there's a built-in widget called "reset-prompt"
that can be used to cause zle to redraw the true prompt.  That plus
the readonly KEYMAP parameter can probably be caused to do the right
thing, though you've still got to redefine all the vi widgets to call
reset-prompt on every mode change.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Vi ZLE bindings: status in prompt?
  2005-04-21  5:24 ` Thomas Köhler
  2005-04-21  7:26   ` Bart Schaefer
@ 2005-04-21 16:09   ` Tom Martin
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Martin @ 2005-04-21 16:09 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

On Thu, Apr 21, 2005 at 07:24:02AM +0200, Thomas K?hler <jean-luc@picard.franken.de> wrote:
> Tom Martin wrote:
> > 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

Thank you very much, this is exactly what I wanted!

Regards,
Tom
-- 
Tom Martin, http://dev.gentoo.org/~slarti

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-04-21 16:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-20 21:47 Vi ZLE bindings: status in prompt? Tom Martin
2005-04-21  5:24 ` Thomas Köhler
2005-04-21  7:26   ` Bart Schaefer
2005-04-21 16:09   ` Tom Martin

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).