zsh-users
 help / color / mirror / code / Atom feed
From: Eric Cook <llua@gmx.com>
To: zsh-users@zsh.org
Subject: Re: tab completion sort by modification time
Date: Sat, 10 Jan 2015 14:52:07 -0500	[thread overview]
Message-ID: <54B182E7.6020804@gmx.com> (raw)
In-Reply-To: <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'


  reply	other threads:[~2015-01-10 20:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-10 19:33 kamaraju kusumanchi
2015-01-10 19:52 ` Eric Cook [this message]
2015-01-11  4:40   ` kamaraju kusumanchi
2015-01-12  5:58     ` kamaraju kusumanchi
2015-01-10 20:11 ` Peter Stephenson
2015-01-10 20:30   ` Mikael Magnusson
2015-01-10 22:08     ` kamaraju kusumanchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54B182E7.6020804@gmx.com \
    --to=llua@gmx.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).