aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2022-09-13 20:56:57 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2022-09-14 00:45:42 +0100
commit88cf84358690fe0f237d10e5fbd8abb953454b91 (patch)
tree9bc5919da8ce7f5e3196f47e9aa14c74420df742
parent2d6e13bbbc3bc429627fac2b617b13d07709f598 (diff)
downloaddotfiles-88cf84358690fe0f237d10e5fbd8abb953454b91.tar.gz
dotfiles-88cf84358690fe0f237d10e5fbd8abb953454b91.tar.bz2
dotfiles-88cf84358690fe0f237d10e5fbd8abb953454b91.zip
(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~
-rw-r--r--Emacs/.config/emacs/config.org22
1 files 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"