From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25063 invoked from network); 5 Jul 2005 15:09:50 -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 15:09:50 -0000 Received: (qmail 17395 invoked from network); 5 Jul 2005 15:09:44 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Jul 2005 15:09:44 -0000 Received: (qmail 15361 invoked by alias); 5 Jul 2005 15:09:36 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9033 Received: (qmail 15346 invoked from network); 5 Jul 2005 15:09:34 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Jul 2005 15:09:34 -0000 Received: (qmail 16288 invoked from network); 5 Jul 2005 15:09:34 -0000 Received: from vanunu.ucsc.edu (128.114.141.22) by a.mx.sunsite.dk with SMTP; 5 Jul 2005 15:09:29 -0000 Received: from localhost (localhost [127.0.0.1]) by vanunu.ucsc.edu (Postfix) with ESMTP id 26A126150C2; Tue, 5 Jul 2005 08:09:47 -0700 (PDT) Date: Tue, 5 Jul 2005 08:09:47 -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: <20050705080757.GB5333@puritan.pnetwork> Message-ID: References: <20050704193711.GF6330@puritan.pnetwork> <20050705080757.GB5333@puritan.pnetwork> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Hi Nikolai: This expands on my previous reply: #!/bin/zsh -f # newvim inputfilearray=( "$@" ) LIMIT=$# for ((i = 1; i <= $LIMIT; i++ )) do eval file="\$$i" if [[ -f $inputfilearray[i] && $inputfilearray[i] == "$(basename $inputfilearray[i])" ]] then inputfilearray[i]="./$inputfilearray[i]" else : fi done command vim "$inputfilearray" There is probably an easier way, but it works. Bill On Tue, 5 Jul 2005, Nikolai Weibull wrote > William Scott wrote: > > > If I am understanding the question correctly, I think you need > > something like > > > > compadd -P "./" > > > > but I don't know if that will cure the problem with the + signs. > > Adding the ./ prefix certainly helps, as Vim won't see the + signs as > special any more. However, the solution I was looking for would > automatically add the ./ prefix when completing a filename beginning > with a + (perhaps only if vim is the command in command position). So > I need even more basic information than the compadd command-line. I was > hoping it could be done using zstyles. > > > Born in Chicago, IL USA; currently residing in Santa Crud, CA > > :-), > nikolai > > -- > Nikolai Weibull: now available free of charge at http://bitwi.se/! > Born in Chicago, IL USA; currently residing in Gothenburg, Sweden. > main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);} >