While Dired is great for browsing the file system, it is often annoying that the buffer is not sorted in the way we want to see. While Dired provides the flexible customizing variable
dired-listing-switches, it is still not convenient to switch between different sorting criteria quickly. For this reason, I created the Emacs extension dired-quick-sort to make sorting Dired an easy story.
To install dired-quick-sort, you can use one of the following ways.
Manual: Download this package and add the following to your
(add-to-list 'load-path "~/path/to/dired-quick-sort") (load "dired-quick-sort.el")
You can add the following to your
~/.emacs.d/init.el for a quick setup:
(require 'dired-quick-sort) (dired-quick-sort-setup)
This will bind “S” in dired-mode to invoke the quick sort hydra and new Dired buffers are automatically sorted according to the criterion that was used to sort last time. See the document of
dired-quick-sort-setup if you need a different setup. It is recommended that at least
-l should be put into
dired-listing-switches. If used with
Start a Dired buffer and press “S”. Now just following the screen to sort in the way you want and the sorting criteria is automatically used for new Dired buffers!