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

Using the same completion function for various commands



Hello,

I'm searching the documentation for quite a while now but can't figure out how 
to do the following:

I wrote a completion function which resides somewhere in $fpath, let's call it 
_foo. But I don't want to have it applied on the command foo only. I want to use 
it on all commands matching a certain pattern, e.g. foo_1, foo_2, ... (or foo_* 
for short). Is it possible to define a context for this (like 
:completion::complete:foo_*::) and use zstyle to bind this completer to it? 
Unfortunately I couldn't figure out how. 
  zstyle "*" completer _<TAB>
only tells me about some built-ins.

Thank you very much and please forgive me in case I oversaw something obvious in 
the documentation.

Martin



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