Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Selectively sorting directory by date in completion
- X-seq: zsh-users 30463
- From: André Marçais <andre@xxxxxxxxxxx>
- To: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>, "Mikael Magnusson" <mikachu@xxxxxxxxx>
- Cc: André Marçais <andre@xxxxxxxxxxx>, <zsh-users@xxxxxxx>
- Subject: Re: Selectively sorting directory by date in completion
- Date: Sun, 22 Mar 2026 11:22:02 +0100
- Archived-at: <https://zsh.org/users/30463>
- In-reply-to: <CAH+w=7ZQ=JLn=9LL+m5sbRt2ZitcQLTBS+nHETnaRHqbg5qvXQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <DH8UZQ4YFIC1.3I46LXJG3V9QL@marcais.net> <CAHYJk3SjtoiCWycWB5EEQHkggZwY-9mNT7TuepdZL4NTjaLMqQ@mail.gmail.com> <CAH+w=7ZQ=JLn=9LL+m5sbRt2ZitcQLTBS+nHETnaRHqbg5qvXQ@mail.gmail.com>
On Sun Mar 22, 2026 at 5:26 AM CET, Bart Schaefer wrote:
>> You might be able to make good use of zstyle -e here, where the value
>> of the style will be evaluated [...]
>
> zstyle -e ':completion:*' file-sort \
> '[[ ${${~PREFIX:-$PWD}:a} = (/tmp|$HOME/(dl|tmp)) ]] && \
> reply=(date)'
Hey, thanks to both of you. I missed the `zstyle -e` option. That's
pretty clean.
>> [...] $REPLY will be used as the style value
>
> It's got to be the $reply array rather than the $REPLY scalar, I think.
Yeah, according to the manual it's `$reply`. (See zshmodules(1).)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author