From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16272 invoked by alias); 10 Jan 2015 20:05:56 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19723 Received: (qmail 10188 invoked from network); 10 Jan 2015 20:05:54 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Message-ID: <54B182E7.6020804@gmx.com> Date: Sat, 10 Jan 2015 14:52:07 -0500 From: Eric Cook User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: zsh-users@zsh.org Subject: Re: tab completion sort by modification time References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:Tx4usdwGcz98xmqWYJ8kqAF2jt57uVDO1MV6qjRCbrV9/4KurlX N8yqdMg5FlYom/DPz1TeVmjHlbd+86Wl5KqzVrqhJ5XsAbAdpF3hrSxSwV1lBhe1+H8HzTe uwc1bI40i7wy+JiuGxeWG/7hVktzHj4zEs7ZWP8qWdEjdn9XjnJAHm31vUO3+vt6KeKtfHO MZe2P35Sgxmzi0r7MKOMg== X-UI-Out-Filterresults: notjunk:1; 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'