From 203f2238a3a53076948938225ebcd2945e6cc1d2 Mon Sep 17 00:00:00 2001 From: noa@gaiwan.org Date: Tue, 18 Jun 2024 20:38:12 +0000 Subject: Nicer settings for dired --- emacs/init.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'emacs') 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. -- cgit 1.4.1-2-gfad0