summary refs log tree commit diff
diff options
context:
space:
mode:
authornoa@gaiwan.org2024-06-18 20:38:12 +0000
committernoa@gaiwan.org2024-06-18 20:38:12 +0000
commit203f2238a3a53076948938225ebcd2945e6cc1d2 (patch)
tree2537cc7470ff3ba19e949f6f1936c75f571341e0
parentc8bc957fd236be7774467add99045acaadc34e3b (diff)
Nicer settings for dired
-rw-r--r--emacs/init.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 1a02446..b8cd99e 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -546,6 +546,14 @@ The misspelled word is taken from OVERLAY.  WORD is the corrected word."
 ;; These are some useful ls switches.  We have to keep -l.  To show dotfiles as well, we use -a.  To sort numbers by number order instead of lumping together ones, twos, and so on, we use -v.  Because we don't have colour, it's nice to have a clear indicator of what is a file and what is a directory, as well as other different things like symlinks which i never remember.  By using -F, a forward slash is appended to every directory.  And to get more easily understandable file sizes, we use -h, which will tell us the file size in kilobytes or megabytes rather than a huge number that means nothing to me.  I won't explain the meaning of the long flag.
 (setopt dired-listing-switches "-alvFh --group-directories-first")
 
+;; By default, don't show dired details
+(add-hook 'dired-mode-hook #'dired-hide-details-mode)
+
+(use-package dired-du :ensure t)
+(setopt dired-du-size-format t)
+;; This can be a little slow
+(add-hook 'dired-mode-hook #'dired-du-mode)
+
 ;;; Indentation: tabs and whitespace settings
 
 ;; In general, my rules for inserting tabs are that the tab key should insert tabs.  I personally prefer tabs to spaces, because tabs work reasonably well whatever font or tab width one chooses to set, whereas spaces are the same width for everyone, except when someone uses a proportional font in which case they are narrower than expected.  Furthermore, people tend to use spaces for alignment, which looks bad when you can't rely on every character being the same width.