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

filename cycling according to age, not name



Normally, I'm happy with the normal filename completion behavior of
zsh.  (After I've customized it to my liking.)  But from time to
time, I would like to say "give me the newest file under the foo
directory".

Is there a way to do this?

The ideal would be that I enter a partial filename (say "foo/") and
then hit a key, and it inserts the newest file in that directory
("foo/x"), and then I hit the key again and it replaces the filename
with the second-youngest ("foo/a").  Right now, the TAB key does
something similar, but it sorts by filename, not by age.

Right now, I have a function which does { ls -lt "$@" | head -15; }
and then I copy and paste, but I'm sure it can be done in a more
convenient manner.

Kai



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