From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22947 invoked from network); 17 Dec 2003 14:25:07 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 17 Dec 2003 14:25:07 -0000 Received: (qmail 12080 invoked by alias); 17 Dec 2003 14:24:44 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6914 Received: (qmail 12043 invoked from network); 17 Dec 2003 14:24:43 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 17 Dec 2003 14:24:43 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [217.160.134.217] by sunsite.dk (MessageWall 1.0.8) with SMTP; 17 Dec 2003 14:24:42 -0000 Received: (root@lyta.akte.de) by lyta.akte.de id convert rfc822-to-8bit; Wed, 17 Dec 2003 15:24:37 +0100 Received: from condor.int.spiegl.de (really 82.82.52.172 [dsl-082-082-052-172.arcor-ip.net]) by lyta.akte.de via kasmail (2.9) id 2003-12-17 15:24:28 KRecCount: 1 Received: from condor.int.spiegl.de (spiegl@localhost [127.0.0.1]) by condor.int.spiegl.de (8.12.9/8.12.9/Debian-5) with ESMTP id hBHEN06j028002 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 17 Dec 2003 15:23:00 +0100 Received: (from spiegl@localhost) by condor.int.spiegl.de (8.12.9/8.12.9/Debian-5) id hBHEN0RN028000 for zsh-users@sunsite.dk; Wed, 17 Dec 2003 15:23:00 +0100 X-Authentication-Warning: condor.int.spiegl.de: spiegl set sender to zsh.Andy@spiegl.de using -f Date: Wed, 17 Dec 2003 15:23:00 +0100 From: Andy Spiegl To: zsh-users@sunsite.dk Subject: Re: Display a function Message-ID: <20031217142300.GA10056@spiegl.de> Mail-Followup-To: zsh-users@sunsite.dk References: <20031217100232.GA2091@spiegl.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: User-Agent: Mutt/1.4i X-PGP-GPG-Keys: mail -s "send pgp" auto@spiegl.de Organization: KasCada GbR > but I don't know how to use > > functionname and then "expand-last-word" expand-last-word() { setopt localoptions extendedglob local skip="${(M)LBUFFER%%[ \;\|\{\}]##}" local word="${(M)${LBUFFER%${skip}}%%[^ \;\|\{\}]##}" exp if (( $+aliases[$word] )); then exp="$aliases[$word]" elif (( $+functions[$word] )); then exp="$functions[$word]" elif (( $+commands[$word] )); then exp="$commands[$word]" fi [[ -n "$exp" ]] && LBUFFER="${LBUFFER%${word}${skip}}${exp}${skip}" } zle -N expand-last-word bindkey "ESCn" expand-last-word And then just press ALT-n after typing the functionname. Andy. -- http://peru.spiegl.de Our project http://radiomaranon.org.pe Radio Marañón, Jaén, Perú o _ _ _ ------- __o __o /\_ _ \\o (_)\__/o (_) -o) ----- _`\<,_ _`\<,_ _>(_) (_)/<_ \_| \ _|/' \/ /\\ ---- (_)/ (_) (_)/ (_) (_) (_) (_) (_)' _\o_ _\_v ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Give a man a fish, and he will eat for a day. Teach a man to fish and he will eat for a lifetime.