Re: Selectively sorting directory by date in completion
Mikael Magnusson <[email protected]> Sun, 22 Mar 2026 19:37:31 +0100
| Newsgroups | gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user |
|---|---|
| Message-ID | <CAHYJk3SUOZXnc4g4fK=C5LCzSm-L77LUgyhVOw+fpkQZiP3WvA@mail.gmail.com> |
On Sun, Mar 22, 2026 at 11:20 AM André Marçais <[email protected]> wrote: > > 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).) Sorry about that, I was probably thinking of the (e::) glob qualifier where you can use either.