about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-04-28 15:49:22 -0500
committerCase Duckworth2022-04-28 15:49:22 -0500
commit7f7ede201b1eb1a9ac7811b716bf39a5adae9896 (patch)
treea6b98b1513e3def1244522ad40327b1be9499b34
parentAdd setup forms to imenu /after/ init (diff)
downloademacs-7f7ede201b1eb1a9ac7811b716bf39a5adae9896.tar.gz
emacs-7f7ede201b1eb1a9ac7811b716bf39a5adae9896.zip
Dim .gitignore files (mostly) in dired
-rw-r--r--init.el5
-rw-r--r--lisp/+dired.el10
2 files changed, 13 insertions, 2 deletions
diff --git a/init.el b/init.el index c2e0460..2137179 100644 --- a/init.el +++ b/init.el
@@ -269,7 +269,7 @@
269 compilation-scroll-output t)) 269 compilation-scroll-output t))
270 270
271(setup dired 271(setup dired
272 (:also-load dired-x +dired) 272 (:require dired-x +dired)
273 (:straight dired+) 273 (:straight dired+)
274 (:option dired-recursive-copies 'always 274 (:option dired-recursive-copies 'always
275 dired-recursive-deletes 'always 275 dired-recursive-deletes 'always
@@ -293,7 +293,8 @@
293 "j" #'+dired-goto-file) 293 "j" #'+dired-goto-file)
294 (:hook #'dired-hide-details-mode 294 (:hook #'dired-hide-details-mode
295 #'hl-line-mode 295 #'hl-line-mode
296 #'lin-mode) 296 #'lin-mode
297 #'+dired-dim-git-ignores)
297 (:+key "C-x C-j" #'dired-jump) 298 (:+key "C-x C-j" #'dired-jump)
298 (dolist (refresh-after-func '(dired-do-flagged-delete)) 299 (dolist (refresh-after-func '(dired-do-flagged-delete))
299 (advice-add refresh-after-func :after #'revert-buffer)) 300 (advice-add refresh-after-func :after #'revert-buffer))
diff --git a/lisp/+dired.el b/lisp/+dired.el index 131d326..9a2e01a 100644 --- a/lisp/+dired.el +++ b/lisp/+dired.el
@@ -15,5 +15,15 @@
15 (push-mark))) 15 (push-mark)))
16 (dired-goto-file file)) 16 (dired-goto-file file))
17 17
18;;; [[https://www.reddit.com/r/emacs/comments/u2lf9t/weekly_tips_tricks_c_thread/i4n9aoa/?context=3][Dim files in .gitignore]]
19
20(defun +dired-dim-git-ignores ()
21 "Dim out .gitignore contents"
22 (require 'vc)
23 (when-let ((ignores (vc-default-ignore-completion-table 'git ".gitignore"))
24 (exts (make-local-variable 'completion-ignored-extensions)))
25 (dolist (item ignores)
26 (add-to-list exts item))))
27
18(provide '+dired) 28(provide '+dired)
19;;; +dired.el ends here 29;;; +dired.el ends here