Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Adding a prefix to certain filename completions



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