Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: conditionally match part of file name to most recently modified file



Vincent Lefevre wrote:
> >   zstyle ':completion:most-recent-file:*' file-patterns '*:all\ files'
>                                                              ^^^^^^^^^^
> Is that all\ files or all-files (used in the manual)?

It's a tag, so it should be all-files.

> >   zstyle ':completion:most-recent-file:*' hidden all
> >   zle -C most-recent-file menu-complete _generic
> >   bindkey '^X.' most-recent-file
> 
> I like that. But the 4th line should probably be:
> 
> zstyle ':completion:most-recent-file:*' file-patterns '*(^/):all\ files'
> 
> to avoid completing on directories (which can often get recent).

That's possible.  You can restrict it on the command line, too; I
sometimes type "*(.)" and complete that.

> For symbolic links, how can one take into account the target instead
> of the link itself?

"*(-^/)" or "*(-/)" should do the trick.  I've had funny results with
non-existent targets when doing this on the command line.

I've wondered for quite a long time why that's not the default since the
times when you want to identify symbolic links themselves are limited.  I
wonder if it's time for another option?  What would it do, make it so
that both (/) and (-/) followed symbolic links but (--/) didn't?

-- 
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

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview



Messages sorted by: Reverse Date, Date, Thread, Author