aboutsummaryrefslogtreecommitdiffstats
path: root/emacs/.emacs.d/init/dired-init.org
blob: 17f90a1565fcd4798e4534030afc5652f255d94d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#+TITLE: Dired

#+BEGIN_SRC emacs-lisp
  (require 'dired)
  (require 'dired-x)
#+END_SRC

Show human-readable sizes in dired buffers.

#+BEGIN_SRC emacs-lisp
  (setq dired-listing-switches "-alh")
#+END_SRC

Show the same info for subdirectories, but don't show the =.= and =..=
directories, since those are most likely already shown in the buffer.

#+BEGIN_SRC emacs-lisp
  (setq dired-subdir-switches "-Alh")
#+END_SRC

Add a keybinding to dired buffers to change to wdired.

#+BEGIN_SRC emacs-lisp
  (defun oni:dired-add-wdired-keybinding ()
    "Add a keybinding for wdired mode."
    (define-key dired-mode-map (kbd "E") 'wdired-change-to-wdired-mode))

  (add-hook 'dired-mode-hook 'oni:dired-add-wdired-keybinding)
#+END_SRC