From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25571 invoked from network); 2 Nov 2004 20:07:54 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 2 Nov 2004 20:07:54 -0000 Received: (qmail 33464 invoked from network); 2 Nov 2004 20:07:47 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Nov 2004 20:07:47 -0000 Received: (qmail 19303 invoked by alias); 2 Nov 2004 20:06:55 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8148 Received: (qmail 19290 invoked from network); 2 Nov 2004 20:06:54 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Nov 2004 20:06:54 -0000 Received: (qmail 32331 invoked from network); 2 Nov 2004 20:06:54 -0000 Received: from unknown (HELO pepper.fruitcom.com) (213.201.177.249) by a.mx.sunsite.dk with SMTP; 2 Nov 2004 20:06:52 -0000 Received: from localhost (pepper [127.0.0.1]) by pepper.fruitcom.com (Postfix) with ESMTP id 43DF46A048; Tue, 2 Nov 2004 21:06:52 +0100 (CET) Received: from pepper.fruitcom.com ([127.0.0.1]) by localhost (pepper [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 24500-02-3; Tue, 2 Nov 2004 21:06:49 +0100 (CET) Received: by pepper.fruitcom.com (Postfix, from userid 1000) id 2DD0E69FF2; Tue, 2 Nov 2004 21:06:49 +0100 (CET) Date: Tue, 2 Nov 2004 21:06:49 +0100 From: Eric Smith To: zsh-users@sunsite.dk Subject: Re: most-recent-file completion and accept-line Message-ID: <20041102200649.GC22898@fruitcom.com> References: <20040922224506.GA18241@fruitcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian os) X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 Thanks a lot Bart. When I tried this previously, I could not get it to work, now it kinda works, so I finally respond. Except you need to press the key combo twice, once for all the possible options to appear and after the second press it accepts one of the listed files. Perhpas I have something configured that interferes with it? Any way FWIW, here is my experience: [eric@pepper ~] 13 $ ls -rt1 delm* delme_fruitcom__08_04.pdf delme_fruitcom__08_04.txt delme_fruitcom__16_04.pdf delme_fruitcom__16_04.txt delme_zz___fruitcom_Monday_June_28_2004.pdf delme_zz___fruitcom_Monday_June_28_2004.txt delme_zz___fruitcom_Saturday_July_10_2004.pdf delme_zz___fruitcom_Saturday_July_10_2004.txt delme_zz___fruitcom_Wednesday_September_15_2004.pdf delme_zz___fruitcom_Wednesday_September_15_2004.txt delme.pdf delme.txt delme.xml [eric@pepper ~] 13 $ ls delme<^X^O> [eric@pepper ~] 13 $ ls delme.pdf delme.pdf delme_zz___fruitcom_Monday_June_28_2004.pdf delme.txt delme_zz___fruitcom_Monday_June_28_2004.txt delme.xml delme_zz___fruitcom_Saturday_July_10_2004.pdf delme_fruitcom__08_04.pdf delme_zz___fruitcom_Saturday_July_10_2004.txt delme_fruitcom__08_04.txt delme_zz___fruitcom_Wednesday_September_15_2004.pdf delme_fruitcom__16_04.pdf delme_zz___fruitcom_Wednesday_September_15_2004.txt delme_fruitcom__16_04.txt [eric@pepper ~] 13 $ ls delme.pdf<^X^O> [eric@pepper ~] 13 $ ls delme.txt delme.txt Bart Schaefer said: > On Thu, 23 Sep 2004, Eric Smith wrote: > > > How do I bind a key combination to complete the most recent file > > and then automatically run accept-line or on this > > filename? > > This seems like an odd question, because any key _combination_ you choose > will be at least as many keystrokes as typing ctrl-o enter. Normally you > want bindings for things that would otherwise take lots of keystrokes. So I bind your function to ^O > However: > > accept-most-recent() { > zle most-recent-file && zle .accept-line > } > zle -N accept-most-recent > bindkey '^X^O' accept-most-recent -- Eric Smith