Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: tab completion sort by modification time
- X-seq: zsh-users 19723
- From: Eric Cook <llua@xxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: tab completion sort by modification time
- Date: Sat, 10 Jan 2015 14:52:07 -0500
- In-reply-to: <CABpbYafixR-PGF9TpOpUzpAWNFauL2b6Kagq7Ub=Pxir5Rt9aw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABpbYafixR-PGF9TpOpUzpAWNFauL2b6Kagq7Ub=Pxir5Rt9aw@mail.gmail.com>
On 01/10/2015 02:33 PM, kamaraju kusumanchi wrote:
> Hi all,
>
> Long time bash user here. Looking to see if zsh can solve my
> particular problem. If it does, I'd like to switch to it.
>
> Say a directory contains a lot of files and say I am only interested
> in the files that were recently edited/created. When doing a tab
> completion inside this directory, I would like the files to be listed
> in the order of modification time (similar to ls -rt). This way the
> latest files show up at the end and I can easily copy/paste their
> names using mouse onto the command line.
>
> Is zsh tab completion system comprehensive enough to do something like this?
>
> FWIW, this feature is not present in bash at the moment -
> http://lists.gnu.org/archive/html/bug-bash/2014-12/msg00161.html . So
> I am looking for alternatives.
>
> thanks
> raju
zstyle ':completion:*' file-sort modification
Will accomplish that for any completer that uses the normal means of
completing filenames.
You can be more specific with the context if you don't want to affect
everything.
zstyle ":completion:*:${EDITOR}:*" file-sort modification
You can also reverse the order:
zstyle ':completion:*' file-sort 'reverse modification'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author