Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Adding a prefix to certain filename completions
- X-seq: zsh-users 9050
- From: William Scott <wgscott@xxxxxxxxxxxxxxxxxx>
- To: Nikolai Weibull <mailing-lists.zsh-users@xxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: Adding a prefix to certain filename completions
- Date: Thu, 7 Jul 2005 07:51:24 -0700 (PDT)
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20050707105817.GA5452@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20050705172846.GB5362@xxxxxxxxxxxxxxxx> <20050704193711.GF6330@xxxxxxxxxxxxxxxx> <20050705042324.GA21301@xxxxxxxxxxxxxxxxx> <20050705080946.GC5333@xxxxxxxxxxxxxxxx> <Pine.OSX.4.58.0507050720380.17349@xxxxxxxxxxxxxxx> <1050706050022.ZM13972@xxxxxxxxxxxxxxxxxxxxxxx> <20050706113154.GA5313@xxxxxxxxxxxxxxxx> <20050707020210.GA5084@xxxxxxxxxxxxxxxx> <1050707054007.ZM14965@xxxxxxxxxxxxxxxxxxxxxxx> <20050707105817.GA5452@xxxxxxxxxxxxxxxx>
Does this work? I sent it a couple of days ago but it seems not to have
appeared on the list.
In any case, it separates the arguments from the filenames, as well as
local files from ones with relative or absolute paths prepended to them,
and only issues ./++foo or the equivalent where needed.
#!/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[@]"
Messages sorted by:
Reverse Date,
Date,
Thread,
Author