Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Using Global aliases to make a "macro" shell
- X-seq: zsh-users 10527
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Using Global aliases to make a "macro" shell
- Date: Mon, 17 Jul 2006 10:24:41 +0100
- In-reply-to: <237967ef0607150905v400bac6cl9dc9add48786074a@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Xns98017A3A81F80zzappergmailcom@xxxxxxxxxxx> <237967ef0607150905v400bac6cl9dc9add48786074a@xxxxxxxxxxxxxx>
"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 <pws@xxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author