Re: Selectively sorting directory by date in completion
André Marçais <[email protected]> Sun, 22 Mar 2026 11:22:02 +0100
| Newsgroups | gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user |
|---|---|
| Message-ID | <[email protected]> |
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).)