Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Funky list-colors
- X-seq: zsh-workers 44991
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsugabubus <zsugabubus@xxxxxxxxxxx>
- Subject: Re: Funky list-colors
- Date: Sat, 07 Dec 2019 22:42:34 +0100
- Cc: zsh-workers@xxxxxxx
- In-reply-to: <20191207205819.ff7scz6ok7ux5dyr@localhost>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20191129122141.rekf7hcxtacjojo2@localhost> <CAH+w=7ZrwCrhkVCvZUAEgomWT_+bydWHEHV_oaZTDc=rnadyTw@mail.gmail.com> <20191129172303.sd5bj3gukhdb7mpp@localhost> <CAH+w=7ZGsuwPx8jm-mGYqtP6u68kG+-HLkk6fJbaj4rUy+dJVg@mail.gmail.com> <20191129203707.ipf4zjkkptg35lpa@localhost> <CAH+w=7Y_TDFMU_uEHtEbmAUiNRLs2Ek_NdbhUU9fAzc8ZxAYww@mail.gmail.com> <20191207205819.ff7scz6ok7ux5dyr@localhost>
zsugabubus wrote:
> > For even more detail you can use something similar to:
> > compadd -o -d labels_array -a filenames_array
>
> It looks wonderful! I think it will work for me. Can I make parts of
> labels bold or colored? (Zsh seems to escape escape codes.) Or it's only
> doable with "list-colors"?
From a normal completion function, you can add color specifications to
_comp_colors. It helps if you're using groups. The following will make
the strings green:
compadd -J group -o -ld labels_array -a filenames_array
_comp_colors+=( "(group)=*=32" )
For an example of this, see the _ps1234 function. This handles
completion for, e.g: PS1='%F{<tab>
In general, this is left up to users to configure with list-colors so
there aren't other examples.
The format style also allows attributes to be specified which is applied
to various messages or heading labels.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author