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

*layers/+spacemacs/spacemacs-editing/packages.el: Enhance the dired sorting #16814

Merged
merged 2 commits into from
Feb 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions layers/+spacemacs/spacemacs-editing/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,12 @@
(use-package dired-quick-sort
:defer t
:init
(spacemacs|add-transient-hook dired-mode-hook
(lambda ()
(let ((dired-quick-sort-suppress-setup-warning 'message))
(dired-quick-sort-setup))))
(define-advice dired-noselect (:before (&rest _) quick-sort-setup)
(let ((dired-quick-sort-suppress-setup-warning 'message))
(dired-quick-sort-setup))
(advice-remove 'dired-noselect 'dired-noselect@quick-sort-setup))
:config
(evil-define-key 'normal dired-mode-map "s" 'hydra-dired-quick-sort/body)
;; workaround for https://gitlab.com/xuhdev/dired-quick-sort/-/issues/14
(define-advice dired-sort-toggle (:before ())
"Recover `dired-actual-switches' with `dired-listing-switches' when long
option \"--sort=...\" exists, and convert \"--sort=time\" to \"-t\"."
(when (string-match-p "--sort=" dired-actual-switches)
(setq dired-actual-switches
(concat dired-listing-switches
(when (string-match-p "--sort=time" dired-actual-switches)
" -t")))))))
(evil-define-key 'normal dired-mode-map "s" 'hydra-dired-quick-sort/body)))

(defun spacemacs-editing/init-drag-stuff ()
(use-package drag-stuff
Expand Down