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

Complete certain external commands separately by path?



Hey again,

I have a problem that i hope can be solved with `zstyle` somehow: I want to
make it so that when i complete external commands, zsh gives me the
possibilities from one particular directory ahead of (and ideally separate
from) all the others. Seems like the most reasonable way to do that might
be to create some kind of sub-group that i can put up top with `zstyle ...
group-order` or whatever?

Here's a contrived illustration of what i mean:

Given a PATH like this:

% print $PATH
/bin1:/bin2

And executables spread across that PATH like this:

% ls /bin1 /bin2
/bin1:
foo1  foo2

/bin2:
foo3  foo4

My current completion behaviour looks like this:

% foo<tab>
completing external command:
foo1  foo2  foo3  foo4

What i *want* is to pull the /bin2 possibilities out into their own group
so i can have them completed first — so i'd have something like this:

% foo<tab>
completing favoured external command:
foo3  foo4
completing external command:
foo1  foo2

Is there an easy way to do this?

Cheers!
dana


Messages sorted by: Reverse Date, Date, Thread, Author