Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Adding a prefix to certain filename completions
- X-seq: zsh-users 9033
- From: William Scott <wgscott@xxxxxxxxxxxxxxxxxx>
- To: Nikolai Weibull <mailing-lists.zsh-users@xxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: Adding a prefix to certain filename completions
- Date: Tue, 5 Jul 2005 08:09:47 -0700 (PDT)
- Cc: zsh-users <zsh-users@xxxxxxxxxx>
- In-reply-to: <20050705080757.GB5333@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20050704193711.GF6330@xxxxxxxxxxxxxxxx> <Pine.OSX.4.58.0507041711010.27812@xxxxxxxxxxxxxxx> <20050705080757.GB5333@xxxxxxxxxxxxxxxx>
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);}
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author