Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sorting files and directories by modification time. #901

Merged
merged 4 commits into from
Oct 25, 2018

Conversation

PhilRunninger
Copy link
Member

Implements #90.

See commit messages for details.

Phil Runninger (mac) added 2 commits October 22, 2018 03:49
This flag is part of the NERDTreeSortOrder list. '[[timestamp]]' sorts
oldest to newest, while '[[-timestamp]]' sorts newest to oldest. Its
position in the array determines whether it is the primary sort (first
position) or secondary sort (any other position). The remaining elements
in the array describe the other sort level following all prior rules. If
needed, a tertiary sort is done alphabetically on the filename.

Examples:

['[[timestamp]]']            - oldest to newest
['\/$','*','[[-timestamp]]'] - dirs, then files, each newest first.

When using this flag, performance is slowed a little because the sortKey
is always recalculated with every sort. Why? Because if a file is saved
(either in vim or by an outside program), NERDTree needs to go back out
to the shell to get the new modification time.
The new `[[timestamp]]' and '[[-timestamp]]' flags are added to support
sorting by modification time.
@PhilRunninger PhilRunninger changed the title Support files and directories by modification time. Support sorting files and directories by modification time. Oct 22, 2018
@PhilRunninger PhilRunninger merged commit 388623e into master Oct 25, 2018
@PhilRunninger PhilRunninger deleted the sort_by_mod_date_90 branch October 25, 2018 02:18
@PhilRunninger PhilRunninger removed the request for review from lifecrisis November 20, 2018 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant