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

Re: Color in completions



On 29 January 2016 at 23:45, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> You can get color in completion listings with the complist module,
> see "man zshmodules" or "info zsh 'The zsh/complist Module'".  In
> particular this reference to $ZLS_COLORS:
>
>   The leading-equals form also allows different parts of the displayed
>   strings to be colored differently.  For this, the pattern has to use the
>   `(#b)' globbing flag and pairs of parentheses surrounding the parts of
>   the strings that are to be colored differently. ...

Managed to do this. Had to:
1. Figure out to use _wanted instead of only compadd
2. Figure out what pattern to give to zstyle:

zstyle ':completion:*:zplugin:*:argument-rest' list-colors
'=(#b)(*)/(*)==1;35=1;33'

When I display $curcontext within _zplugin (after adding -C to
_arguments), it shows: :complete:zplugin:argument-rest. I wonder why
do I need the additional ":*:" before "argument-rest" ? Or even the
first one.

https://github.com/psprint/zplugin/blob/master/_zplugin

Best regards,
Sebastian Gniazdowski



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