Welcome to Vifm Q&A, where you can ask questions about using Vifm. Registration is optional, anonymous posts are moderated. E-mail and GitHub logins are enabled.
0 votes
in vifm by

I would like to be able to sort a directory by the time the files were added to the directory.

mtime doesn't fully fit the purpose. A file that has been modified long ago but copied to a directory only recently would have the old date as mtime, and not appear at the top of the listing when sorted by mtime.

ctime, unfortunately, also doesn't work for my intent. On macOS it appears to also when a file was accessed. So, recently accessed files would appear at the top of the list.

On macOS there is also a date called "Date Added". It is used by Finder and this is what I want to see and sort by most of the time. It can be inspected by running mdls $file and checking the key kMDItemDateAdded.

Is there maybe a way to somehow use this macOS-specific date for sorting?

1 Answer

0 votes
by

There are no custom keys for sorting, so you can't integrate such sorting (running mdls seems to be the way to obtain this timestamp which isn't returnted by usual API; although maybe there is some library for that as well).

If you need it only rarely, an option is to sort by an external command and construct a very/unsorted custom view (%U) like in:

:!ls -t %U

This obviously needs a tool or script that can do such sorting.

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.
...