From 88cf84358690fe0f237d10e5fbd8abb953454b91 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Tue, 13 Sep 2022 20:56:57 +0100 Subject: (Emacs)~changes to dired configuration In order of complexity: - set (leader "dd") to ~dired~ rather than ~dired-jump~, because I think it's better to have an option to choose directory - +dired/maybe-frame -> dired-other-frame (just use another frame always) - dired-omit-mode config: - When ~dired-hide-details-mode~ is on, hide all dot(files/directories) - When ~dired-hide-details-mode~ is off, show all files (turn off ~dired-omit-mode~) - This is achieved by hooking ~+dired/omit-files~ (which does the above) to ~dired-hide-details-mode-hook~ --- Emacs/.config/emacs/config.org | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 29f3a7b..3e58bf6 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -1478,19 +1478,27 @@ are some corners I'd like to adjust). (use-package dired :defer t :straight nil - :commands (dired find-dired dired-jump) - :hook - (dired-mode-hook . dired-hide-details-mode) - (dired-mode-hook . auto-revert-mode) + :commands (dired find-dired) :init - (setq-default dired-listing-switches "-AFBl --group-directories-first") + (setq-default dired-listing-switches "-AFBl --group-directories-first" + dired-omit-files "^\\.") + (defvar +dired/omit-mode nil) + (defun +dired/omit-dot-files () + (interactive) + (dired-omit-mode (if +dired/omit-mode 1 -1)) + (setq-local +dired/omit-mode (not +dired/omit-mode)) + (revert-buffer)) + :hook + (dired-mode-hook . dired-hide-details-mode) + (dired-mode-hook . auto-revert-mode) + (dired-hide-details-mode-hook . +dired/omit-dot-files) :general (leader :infix "d" "w" #'wdired-change-to-wdired-mode "f" #'find-dired - "D" #'+dired/maybe-frame - "d" #'dired-jump + "d" #'dired + "D" #'dired-other-frame "l" (proc (interactive) (find-dired "~/Text/PDFs/" "-iname 'cs[0-9][0-9][0-9].pdf' -or -iname 'ma[0-9][0-9][0-9]*.pdf'"))) :config (with-eval-after-load "evil-collection" -- cgit v1.2.3-13-gbd6f