From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 331 invoked from network); 7 Feb 2006 15:24:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Feb 2006 15:24:59 -0000 Received: (qmail 62865 invoked from network); 7 Feb 2006 15:24:53 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Feb 2006 15:24:53 -0000 Received: (qmail 26092 invoked by alias); 7 Feb 2006 15:24:43 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9892 Received: (qmail 26082 invoked from network); 7 Feb 2006 15:24:42 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 Feb 2006 15:24:42 -0000 Received: (qmail 61680 invoked from network); 7 Feb 2006 15:24:42 -0000 Received: from xproxy.gmail.com (66.249.82.201) by a.mx.sunsite.dk with SMTP; 7 Feb 2006 15:24:41 -0000 Received: by xproxy.gmail.com with SMTP id r21so1832876wxc for ; Tue, 07 Feb 2006 07:24:40 -0800 (PST) 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= Received: by 10.70.60.11 with SMTP id i11mr7959154wxa; Tue, 07 Feb 2006 07:24:40 -0800 (PST) Received: from localhost ( [65.211.29.191]) by mx.gmail.com with ESMTP id i34sm578812wxd.2006.02.07.07.24.34; Tue, 07 Feb 2006 07:24:39 -0800 (PST) Date: Tue, 7 Feb 2006 10:24:26 -0500 From: Mike Hernandez To: Zsh users list Subject: Re: fastest way to bring up a shell function for editing? Message-ID: <20060207152426.GE16047@dementia.beyondnormal.net> Mail-Followup-To: Zsh users list References: <20060207143637.GA22181@princo> <20060207144659.GB16047@dementia.beyondnormal.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sent-From-PDA: Yes User-Agent: Mutt/1.5.9i 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