Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zle separability
- X-seq: zsh-users 8765
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx (Zsh users list)
- Subject: Re: zle separability
- Date: Thu, 28 Apr 2005 11:03:29 +0100
- In-reply-to: <20050428054551.GA6338@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20050424193737.GA27777@xxxxxxxxxxxxxx> <20050424230816.GA78@DervishD> <20050425075146.GC28168@xxxxxxxxxxxxxx> <20050425104950.GA4108@DervishD> <20050425110410.GD28168@xxxxxxxxxxxxxx> <20050425113925.GA4578@DervishD> <20050425115849.GA17635@xxxxxxxxxxxxxx> <20050425160249.GC8211@DervishD> <20050428054551.GA6338@xxxxxxxxxxxxxx>
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@xxxxxxx> 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.
**********************************************************************
Messages sorted by:
Reverse Date,
Date,
Thread,
Author