zsh-users
 help / color / mirror / code / Atom feed
* Re: zle separability
       [not found]               ` <20050428054551.GA6338@a5.repetae.net>
@ 2005-04-28 10:03                 ` Peter Stephenson
  2005-04-28 10:42                   ` DervishD
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 2005-04-28 10:03 UTC (permalink / raw)
  To: Zsh users list

Frederik Eaton wrote:
> So 'vared' has history? How do I enable it?

(I moved this from workers to users since it's entirely about existing
features.)

Use the option -h to pick up the normal command history.  It doesn't
save the value, you have to use "print -s" for that.

Picking up a special history requires a little more work, but see the
function zcalc in the distribution which uses a push/pop mechanism for
the history added by Wayne.  You need 4.2.about1orso.

A simple wrapper around vared works:

varedhist() {
  history -ap ~/.vared_history
  vared -h "$@" || return 1
  print -s -- ${(P)argv[-1]}
}

This works like "vared -h" but uses ~/.vared_history as the history file
and saves new values to it.  The file behaves exactly like any other
history file, respecting all the usual options.  You can set them
locally in varedhist if you like.

Obviously, lots of extensions are possible.  You could make a special
variable history directory and keep a separate history for each
variable, for example, or add an argument to use a specified history file.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


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

* Re: zle separability
  2005-04-28 10:03                 ` zle separability Peter Stephenson
@ 2005-04-28 10:42                   ` DervishD
  0 siblings, 0 replies; 2+ messages in thread
From: DervishD @ 2005-04-28 10:42 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh users list

    Hi Peter :)

 * Peter Stephenson <pws@csr.com> dixit:
> Frederik Eaton wrote:
> > So 'vared' has history? How do I enable it?
> Use the option -h to pick up the normal command history.  It doesn't
> save the value, you have to use "print -s" for that.

    Sht. I missed that :((( Sorry for saying that vared doesn't
support history access.
 
    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...


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

end of thread, other threads:[~2005-04-28 10:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20050424193737.GA27777@a5.repetae.net>
     [not found] ` <20050424230816.GA78@DervishD>
     [not found]   ` <20050425075146.GC28168@a5.repetae.net>
     [not found]     ` <20050425104950.GA4108@DervishD>
     [not found]       ` <20050425110410.GD28168@a5.repetae.net>
     [not found]         ` <20050425113925.GA4578@DervishD>
     [not found]           ` <20050425115849.GA17635@a5.repetae.net>
     [not found]             ` <20050425160249.GC8211@DervishD>
     [not found]               ` <20050428054551.GA6338@a5.repetae.net>
2005-04-28 10:03                 ` zle separability Peter Stephenson
2005-04-28 10:42                   ` DervishD

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