Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Selectively sorting directory by date in completion
- X-seq: zsh-users 30462
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Cc: André Marçais <andre@xxxxxxxxxxx>, zsh-users@xxxxxxx
- Subject: Re: Selectively sorting directory by date in completion
- Date: Sat, 21 Mar 2026 21:26:58 -0700
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=WDT+VIfvOtBMwtfwM4c2JdiWNWLREYr+y/YNpbOKqpA=; fh=2FDrVbG5eBoC5FiiJWBsHxWe+Oa4IvNP91w7zrHOyj0=; b=MXfQQjFuJ2ov/k/RhbkdR+a7boiwrtB3ryTsHRfIvnkYwQoMtC4n1paTtl+bruofxn QHE3ds4l9QsPzHICiq+ZHNwghKgKuhbnTkGIwEPWhYWu9ujim3afA5HKaFUO3Ejt8l8s qxdqmpxaGq676DdedjszDN/t7zLHYyRvo1XcU2yMPWUuy6MrFNH6BrBEb7944hnYhWU5 fppqIG/HSVBi9DCZzkjp8oobkAu3YBGURQhTffHtDMIxmACQE3uvTsM4AnNMDdwpVgsZ O+mrJYkEWh1xaheocc2Kp9hM+qxm8oi142vvu5FuChjdUqo3UmwxI5Q9JdMpp7LNBagO LLMw==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1774153630; cv=none; d=google.com; s=arc-20240605; b=WlifW3pXNh77b7dc2k2HkQWWsS2gdaNG6OkzTA7XY41Z6P6Umvk78pmz9+4XR0L+hu Kve8+GZHTldXTb9DQCBcScnbZo7dT3ZY5cdxrFv/m1/actW8G3sx765MZHlu2zubfRCs jVKy9nA+s1sdS6sfWBSp4KANybNCcXwfwR35jUOH0v57zwv1JRMiwc9iwobfnn1XOruA 2a7yJuv6sFc88Yq1DqGG1o7w7iDhVAApJobdlirpqpX/XTbYqnOE6CPBpgXWAbuBX361 I2VJ3KmMYDE7oj5GiD50V9o7j2iVHhVKpCdrcPqfW9mqDZp+rhoa9VGoaSTkdu2ubuXD BxJw==
- Archived-at: <https://zsh.org/users/30462>
- In-reply-to: <CAHYJk3SjtoiCWycWB5EEQHkggZwY-9mNT7TuepdZL4NTjaLMqQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <DH8UZQ4YFIC1.3I46LXJG3V9QL@marcais.net> <CAHYJk3SjtoiCWycWB5EEQHkggZwY-9mNT7TuepdZL4NTjaLMqQ@mail.gmail.com>
On Sat, Mar 21, 2026 at 9:14 PM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> > So here is the solution I came up with: I redefined `_path_files` by
> > symlinking `~/.local/share/zsh/site-functions/_path_files_old` to
> > `/usr/share/zsh/functions/Completion/Unix/_path_files` and by creating
> > the file `~/.local/share/zsh/site-functions/_path_files`
>
> You might be able to make good use of zstyle -e here, where the value
> of the style will be evaluated and then the parameter $REPLY will be
> used as the style value
It's got to be the $reply array rather than the $REPLY scalar, I think.
zstyle -e ':completion:*' file-sort \
'[[ ${${~PREFIX:-$PWD}:a} = (/tmp|$HOME/(dl|tmp)) ]] && \
reply=(date)'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author