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

Re: Complete certain external commands separately by path?



dana wrote on Tue, Sep 12, 2017 at 02:32:50 -0500:
> # Put a `commands-bin2` tag ahead of the regular `commands` one
> zstyle ':completion:*:-command-:*' tag-order 'commands:-bin2:favoured\ external\ command commands *'
> zstyle ':completion:*:-command-:*:commands-bin2' ignored-patterns "^(${(kj<|>)commands[(R)/bin2/*]})"
> zstyle ':completion:*:-command-:*:commands' ignored-patterns "(${(kj<|>)commands[(R)/bin2/*]})"
> 
> If you can think of anything wrong with this method please let me know.
> Otherwise it seems to work so far!

It only affects command names that are completed at command position,
i.e., it affects this:

    % <TAB>

but not any of these:

    % command <TAB>
    % env X=Y <TAB>
    % rsync -e <TAB>
    ⋮



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