From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 833 invoked from network); 11 Jan 2004 16:15:25 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 11 Jan 2004 16:15:25 -0000 Received: (qmail 22852 invoked by alias); 11 Jan 2004 16:15:05 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6989 Received: (qmail 22823 invoked from network); 11 Jan 2004 16:15:05 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 11 Jan 2004 16:15:05 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [213.201.175.88] by sunsite.dk (MessageWall 1.0.8) with SMTP; 11 Jan 2004 16:15:4 -0000 Received: from localhost (pepper [127.0.0.1]) by pepper.fruitcom.com (Postfix) with ESMTP id 055226A008; Sun, 11 Jan 2004 17:15:04 +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 07624-01-2; Sun, 11 Jan 2004 17:15:00 +0100 (CET) Received: by pepper.fruitcom.com (Postfix, from userid 1000) id F050569E84; Sun, 11 Jan 2004 17:15:00 +0100 (CET) Date: Sun, 11 Jan 2004 17:15:00 +0100 From: Eric Smith - Fruitcom To: Zsh Users Subject: Re: function to return most recently modified file to command line - cycling in both directions Message-ID: <20040111161500.GF1219@fruitcom.com> References: <20031222235658.GA18521@fruitcom.com> <1139.1072141716@athlon> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1139.1072141716@athlon> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian os) Hi Oliver This approach of yours has radically improved my environment. Thank you. BTW, the _match bit did not work until I moved that token in front of completer (for some reason). I would like to know if you have (or can perhaps think of) a way to cycle backwards through the file list - say if you miss the file that you want. Like you would with and in back-i-search. ciao According to Oliver Kiddle on Tue, Dec 23, 2003 at 02:08:36AM +0100: > Eric Smith wrote: > > I would like to have a function ideally to bind to a key combination > > that returns the most recent file to the command line. > > > > Like I might type > > $ acroread > > I do this with a completion widget: > 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 '*(.):normal\ files' > zstyle ':completion:most-recent-file:*' hidden all > bindkey '^Xm' most-recent-file > zle -C most-recent-file menu-complete _generic > > > Specify the type of file say `pdf' or `txt' for the latest instance > > of that type of file. > > The _match bit allows that: type *.pdf and ^Xm will get you the most > recent .pdf file. > > > Also the function could automatically add an after returning the > > filename. > > You can probably use a normal zle widget which invokes this followed by > accept-line. > > You'd lose the feature that invoking this multiple times cycles through > files in modification order though. > > I'm now away for a couple of weeks, by the way. Have a good Christmas > everyone. > > Oliver -- Eric Smith Fruitcom BV Tel: +31 15 219 0468 Fax: +31 15 219 0524 Mobile: +31 6 551 76300 www.fruitcom.com PO Box 2855 2601 CW Delft The Netherlands