Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: what zshcompsys-syntax is equals compctl -C -f ?
- X-seq: zsh-users 9617
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: what zshcompsys-syntax is equals compctl -C -f ?
- Date: Fri, 4 Nov 2005 10:33:00 +0000
- In-reply-to: <436B2B11.1070503@xxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Cambridge Silicon Radio
- References: <436B2B11.1070503@xxxxxxxx>
Eike Kroemer <kroemer@xxxxxxxx> wrote:
> I used "compctl -C -f" to avoid path-lookup in completion.
> For example assume my $PWD has a subdirectory "bin/" and I want to call
> "Script" located in this dir.
So you want local directories (not using CDPATH), and any executable
files in them, right?
Try adding:
_local_exes() {
_files -g "*(*)"
}
compdef _local_exes -command-
after the point where "compinit" runs. This makes command context
(which means basically what you think) run your function instead of the
default. The function uses a glob qualifier to match all executable files.
The _files function automatically lets you search for the file in subdirectories
(in fact, I've discovered I'm a bit vague on how to stop it doing that,
but luckily you don't need to).
All sorts of variations are possible. You should be able to get away with
putting a suitable function in your $fpath, but I couldn't get that to work
(it get being overridden however I organised my fpath and deleted the
dumped configuration), so just stick with the lines above or similar.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author