Remove --group-directories-first arg for bsd ls

This commit is contained in:
Henrik Lissner 2019-03-02 13:49:39 -05:00
parent cc1aad8f2e
commit c07f43bba3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -17,17 +17,18 @@
image-dired-temp-image-file (concat image-dired-dir "temp-image") image-dired-temp-image-file (concat image-dired-dir "temp-image")
image-dired-temp-rotate-image-file (concat image-dired-dir "temp-rotate-image")) image-dired-temp-rotate-image-file (concat image-dired-dir "temp-rotate-image"))
:config :config
(setq dired-listing-switches "-aBhl --group-directories-first") (let ((args (list "-aBhl" "--group-directories-first")))
(when IS-BSD
(when IS-BSD ;; Use GNU ls as `gls' from `coreutils' if available. Add `(setq
;; Use GNU ls as `gls' from `coreutils' if available. Add `(setq ;; dired-use-ls-dired nil)' to your config to suppress the Dired warning
;; dired-use-ls-dired nil)' to your config to suppress the Dired warning ;; when not using GNU ls. We must look for `gls' after
;; when not using GNU ls. We must look for `gls' after ;; `exec-path-from-shell' was initialized to make sure that `gls' is in
;; `exec-path-from-shell' was initialized to make sure that `gls' is in ;; `exec-path'
;; `exec-path' (if-let* ((gls (executable-find "gls")))
(if-let* ((gls (executable-find "gls"))) (setq insert-directory-program gls)
(setq insert-directory-program gls) (setq args (delete "--group-directories-first" args))
(message "Cannot find `gls` (GNU ls). Install coreutils via your system package manager"))) (message "Cannot find `gls` (GNU ls). Install coreutils via your system package manager")))
(setq dired-listing-switches (string-join args " ")))
(defun +dired|sort-directories-first () (defun +dired|sort-directories-first ()
"List directories first in dired buffers." "List directories first in dired buffers."