zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-users@sunsite.dk
Subject: Re: Using Global aliases to make a "macro" shell
Date: Mon, 17 Jul 2006 10:24:41 +0100	[thread overview]
Message-ID: <200607170924.k6H9OfS4007417@news01.csr.com> (raw)
In-Reply-To: <237967ef0607150905v400bac6cl9dc9add48786074a@mail.gmail.com>

"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@csr.com>                  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


      parent reply	other threads:[~2006-07-17  9:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-15 11:00 zzapper
2006-07-15 16:05 ` Mikael Magnusson
2006-07-15 16:22   ` zzapper
2006-07-15 19:46     ` Mikael Magnusson
2006-07-15 22:22       ` zzapper
2006-07-17  9:24   ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200607170924.k6H9OfS4007417@news01.csr.com \
    --to=pws@csr.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).