Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Adding a prefix to certain filename completions
- X-seq: zsh-users 9036
- From: John Reese <john.reese@xxxxxxxxx>
- To: zsh-users <zsh-users@xxxxxxxxxx>
- Subject: Re: Adding a prefix to certain filename completions
- Date: Tue, 5 Jul 2005 09:56:12 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=h8ddoh/FJdaYXkLapHFb+bSmTEEoA2IkAhrfsvzvlJ88OxuxKnvlKqPyO/ExfK0kM+0/LboE8UNMA4KYdUBnYOpbZoQ7lK2WhogoKk/7KkkC0pm4zqrY6QD43EZ8bg7fnJJYwQYgjwgzYDVKJDwrYIML5gjkz6ZbiwvT3U8A0A0=
- In-reply-to: <20050705172846.GB5362@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20050704193711.GF6330@xxxxxxxxxxxxxxxx> <20050705042324.GA21301@xxxxxxxxxxxxxxxxx> <20050705080946.GC5333@xxxxxxxxxxxxxxxx> <Pine.OSX.4.58.0507050720380.17349@xxxxxxxxxxxxxxx> <20050705172846.GB5362@xxxxxxxxxxxxxxxx>
- Reply-to: John Reese <john.reese@xxxxxxxxx>
2005/7/5, Nikolai Weibull <mailing-lists.zsh-users@xxxxxxxxxxxxxxxxxxxxxx>:
...
> I know that the completion system can be made to suit this need.
> Filenames beginning with a = are escaped properly with the right
> settings.
>
Unfortunately, I'm behind the times, but the following works with the
old completion system. I'm sure something along the same lines can
done with zstyle and compadd and all that other wackiness.
compctl -f -x 'S[+]' -f -P './' -- vim
That's: for vim, complete filenames, except for arguments starting
with +, for which insert "./" at the beginning and then complete
filenames. Note that the + already has to be on the command-line; if
you have menu completion on and you type "vim <tab>", filenames
starting with + won't match the above rule and they won't get the ./
prepended. But "vim +<tab>" does the right thing.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author