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

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



On 2007-06-18 11:09:48 +0100, Peter Stephenson wrote:
> You can complete the most recent matching file using a generic completer:
> 
>   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'
                                                             ^^^^^^^^^^
Is that all\ files or all-files (used in the manual)?

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

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

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



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