Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Funky list-colors
- X-seq: zsh-workers 44987
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsugabubus <zsugabubus@xxxxxxxxxx>, "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: Funky list-colors
- Date: Thu, 05 Dec 2019 08:44:03 +0100
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- In-reply-to: <CAH+w=7Y_TDFMU_uEHtEbmAUiNRLs2Ek_NdbhUU9fAzc8ZxAYww@mail.gmail.com>
- 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>
Bart wrote:
> For even more detail you can use something similar to:
> compadd -o -d labels_array -a filenames_array
> where there is one entry in $labels_array for each entry in
> $filenames_array. The completion system will arrange to build a grid
> of the labels and names so that each name is paired with the
> corresponding element from the labels. However, it does place the
> labels to the right of the names rather than to the left.
Actually the array specified with -d is not just for the labels but for
the whole string - match and label. So you can make any change you
like to how the match appears in the completion listing for your
own custom version of the LIST_TYPES option.
The common rendering of the match followed by a separator (-- by
default) and a label is not part of compadd. (in terms of man
pages/documentation sections, it is part of zshcompsys rather than
zshcompwid). In most, but by no means all, cases this is done from
_describe.
This also means that for things like the list-colors style, patterns
match the whole display string. It can thus be used to change
attributes for either or both match and label. For an example, try:
'=(#b)(--) (*)==32=3'
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author