summaryrefslogtreecommitdiffstats
path: root/lisp/init-dired.el
blob: 89050545dedd978ee9dbdbf236e0746bc5537a9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
;;; init-dired.el --- configure dired  -*- lexical-binding:t -*-
;;; Commentary:
;;; Code:

(use-package dired
  :init
  ;; show human readable sizes in dired
  (setq dired-listing-switches "-alh")

  :bind (:map dired-mode-map
              ("M-<up>" . dired-up-directory)
              ("<backspace>" . dired-up-directory))

  :config
  ;; group directories first in dired if supported
  (when (eq 0 (call-process insert-directory-program
                            nil nil nil "--group-directories-first"))
    (setq dired-listing-switches (concat dired-listing-switches
                                         " --group-directories-first"))))

(provide 'init-dired)

;;; init-dired.el ends here