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

Re: default completion function



On Wed, 7 Mar 2018 13:28:38 +0100
Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
> Hello everybody, I would like to make the completion function
> _gnu_generic the default completion for those functions that don't
> have something more specific attached to them.
> If I use:
> 
> zstyle ':completion:*' completer _gnu_generic
> 
> a command like docker that has his own completion loses it and gets
> completed with _gnu_generic.
> How can I set a default like that without overwriting existing more
> specific completion?

The obvious way (so probably this is too simple) is to override the
function _default, the normal version of which you'll find in your
$fpath.  As long as your function starts with "#compdef -default-" and
is earlier in your $fpath it should be used in preference.

pws



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