From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17567 invoked from network); 17 Jul 2006 09:27:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Jul 2006 09:27:53 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 48285 invoked from network); 17 Jul 2006 09:27:39 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Jul 2006 09:27:39 -0000 Received: (qmail 8496 invoked by alias); 17 Jul 2006 09:27:32 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10527 Received: (qmail 8487 invoked from network); 17 Jul 2006 09:27:31 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 Jul 2006 09:27:31 -0000 Received: (qmail 47185 invoked from network); 17 Jul 2006 09:27:31 -0000 Received: from cluster-c.mailcontrol.com (168.143.177.190) by a.mx.sunsite.dk with SMTP; 17 Jul 2006 09:27:30 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly19c.srv.mailcontrol.com (MailControl) with ESMTP id k6H9PGdY026910 for ; Mon, 17 Jul 2006 10:27:22 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Mon, 17 Jul 2006 10:24:42 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.4/8.13.4) with ESMTP id k6H9OglM007420 for ; Mon, 17 Jul 2006 10:24:42 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.13.4/8.13.4/Submit) with ESMTP id k6H9OfS4007417 for ; Mon, 17 Jul 2006 10:24:42 +0100 Message-Id: <200607170924.k6H9OfS4007417@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-users@sunsite.dk Subject: Re: Using Global aliases to make a "macro" shell In-reply-to: <237967ef0607150905v400bac6cl9dc9add48786074a@mail.gmail.com> References: <237967ef0607150905v400bac6cl9dc9add48786074a@mail.gmail.com> Comments: In-reply-to "Mikael Magnusson" message dated "Sat, 15 Jul 2006 18:05:04 +0200." Date: Mon, 17 Jul 2006 10:24:41 +0100 From: Peter Stephenson X-OriginalArrivalTime: 17 Jul 2006 09:24:42.0266 (UTC) FILETIME=[D5B17FA0:01C6A982] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-07-00-10 (www.mailcontrol.com) on 10.67.0.129 "Mikael Magnusson" wrote: > A related very useful keybind is > bindkey "^N" _most_recent_file > although it completes files and directories alike, despite the name. > Also very useful is > bindkey "^[^N" _most_accessed_file You can get this effect without actually using any new widgets with the "generic" method. See "From Bash to Zsh" page 407, though it gets posted here every now and then, too. For the effect of _most_recent_file, except that menu completion is active so you can cycle back through previously modified files: zstyle ':completion:most-recent-file:*' match-original both zstyle ':completion:most-recent-file::::' completer _menu _files _match zstyle ':completion:most-recent-file:*' file-sort modification zstyle ':completion:most-recent-file:*' file-patterns '*:all\ files' zstyle ':completion:most-recent-file:*' hidden all zle -C most-recent-file menu-complete _generic (and bind "most-recent-file" to a key). The "hidden" style removes the completion list. The presence of the "_match" completer and the "match-original" style allow you to complete patterns: first it tries to complete as if there were a pattern already there, then it inserts a "*". For the effect of _most_accessed_file, replace "modification" in the "file-sort" style by "access" (and rename the contexts and widget). -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php