Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: fastest way to bring up a shell function for editing?
- X-seq: zsh-users 9892
- From: Mike Hernandez <sequethin@xxxxxxxxx>
- To: Zsh users list <zsh-users@xxxxxxxxxx>
- Subject: Re: fastest way to bring up a shell function for editing?
- Date: Tue, 7 Feb 2006 10:24:26 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:sent-from-pda:user-agent; b=TRCpxUyMIlamD16Rz39AiEWdvOkTqlmbx4sfwrjAXasDi2IUea1E0RqFYJ8jKlXxwzYHNDCaH/7n0vvKyCiijDs/lIjo3mcV3sMX5SUpr+eLZL7x2VjxpDUEfHacfACWp9rHqc+Ym5I/LJYos5wytWhkNEtBw4oprukC3rGueVs=
- In-reply-to: <EXCHANGE03dU2yjwD740000a89d@xxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Zsh users list <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20060207143637.GA22181@princo> <20060207144659.GB16047@xxxxxxxxxxxxxxxxxxxxxxxxx> <EXCHANGE03dU2yjwD740000a89d@xxxxxxxxxxxxxxxxxx>
- Sent-from-pda: Yes
On Tue, Feb 07, 2006 at 02:56:11PM +0000, Peter Stephenson wrote:
> Mike Hernandez wrote:
> > Try this:
> >
> > % foo(){ echo "this is a function" }
> > % foo
> > this is a function
> > % vared foo()
> > function> echo "vared works... sort of"
> > % foo
> > vared works... sort of
>
> Err, actually what you're doing there is defining two functions, one
> called vared and one called foo, with the same body. The function>
> prompt is the usual continuation prompt. You'd get it just the same if
> the first line were:
> % foo() {
>
> Of course, in a case like this you can simply up-arrow and edit the
> foo()... a few lines before.
>
> Clint's answer is the most useful... the function zed supplied with the
> shell does this. Remember to autoload it. Pedantically,
>
> autoload -Uz zed
> zed -f foo
>
> Hit ^J when you're finished (or ^X^W if your terminal is weird).
>
I knew if I said something silly like that, that I'd end up learning
something in the end :)
Mike
Messages sorted by:
Reverse Date,
Date,
Thread,
Author