From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28213 invoked from network); 5 Jul 2005 17:07:22 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 Jul 2005 17:07:22 -0000 Received: (qmail 20369 invoked from network); 5 Jul 2005 17:07:16 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Jul 2005 17:07:16 -0000 Received: (qmail 9303 invoked by alias); 5 Jul 2005 17:07:06 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9038 Received: (qmail 9293 invoked from network); 5 Jul 2005 17:07:05 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Jul 2005 17:07:05 -0000 Received: (qmail 19213 invoked from network); 5 Jul 2005 17:07:05 -0000 Received: from vanunu.ucsc.edu (128.114.141.22) by a.mx.sunsite.dk with SMTP; 5 Jul 2005 17:07:01 -0000 Received: from localhost (localhost [127.0.0.1]) by vanunu.ucsc.edu (Postfix) with ESMTP id 8DA236151C8; Tue, 5 Jul 2005 10:07:19 -0700 (PDT) Date: Tue, 5 Jul 2005 10:07:19 -0700 (PDT) From: William Scott X-X-Sender: wgscott@vanunu.ucsc.edu To: Nikolai Weibull Cc: zsh-users Subject: Re: Adding a prefix to certain filename completions In-Reply-To: <20050705172846.GB5362@puritan.pnetwork> Message-ID: References: <20050704193711.GF6330@puritan.pnetwork> <20050705042324.GA21301@picard.franken.de> <20050705080946.GC5333@puritan.pnetwork> <20050705172846.GB5362@puritan.pnetwork> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 > > function vim { command vim ./"$@" } > > That will definitely not work. Specifically it won=E2=80=99t work for mu= ltiple > file arguments (or options for that matter), > nikolai The longer version I sent about an hour ago does (once you correct the last line as I quickly found). It tests each element of the input array and decides if it is a file or not (i.e., is an argument). Then if that element of the array is in the $PWD, it appends your fix, otherwise it leaves it alone.