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 9890
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx (Zsh users list)
- Subject: Re: fastest way to bring up a shell function for editing?
- Date: Tue, 07 Feb 2006 14:56:11 +0000
- In-reply-to: <20060207144659.GB16047@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20060207143637.GA22181@princo> <20060207144659.GB16047@xxxxxxxxxxxxxxxxxxxxxxxxx>
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).
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
Messages sorted by:
Reverse Date,
Date,
Thread,
Author