diff --git a/modules/emacs/dired/autoload.el b/modules/emacs/dired/autoload.el new file mode 100644 index 000000000..9b8a097ab --- /dev/null +++ b/modules/emacs/dired/autoload.el @@ -0,0 +1,8 @@ +;;; emacs/dired/autoload.el -*- lexical-binding: t; -*- + +;;;###autoload +(defun +dired/quit-all () + "Kill all `dired-mode' buffers." + (interactive) + (mapc #'kill-buffer (doom-buffers-in-mode 'dired-mode)) + (message "Killed all dired buffers")) diff --git a/modules/emacs/dired/config.el b/modules/emacs/dired/config.el index 432e37c97..cbce83d3f 100755 --- a/modules/emacs/dired/config.el +++ b/modules/emacs/dired/config.el @@ -49,14 +49,10 @@ only variant that supports --group-directories-first." (put 'dired-find-alternate-file 'disabled nil) (map! :map dired-mode-map - ;; Kill buffer when quitting dired buffers - [remap quit-window] (λ! (quit-window t)) + ;; Kill all dired buffers on q + :ng "q" #'+dired/quit-all ;; To be consistent with ivy/helm+wgrep integration - "C-c C-e" #'wdired-change-to-wdired-mode - ;; Stop dired from creating new buffers when we enter a new directory or - ;; travel up the tree - :n "RET" #'dired-find-alternate-file - :ng "^" (λ! (find-alternate-file "..")))) + "C-c C-e" #'wdired-change-to-wdired-mode)) (use-package! dired-rsync