is there a way to have dired operate in a single window so that when I traverse through directories I don't have n number of dired buffers for the intermediate directories? However - if I start another dired buffer in a completely separate directory (from the minibuffer rather than hitting [enter] on a subdirectory in an already open dired instance) I'd like to retain the two separate dired buffers... I guess I'm using ido-dired since I have ido-mode on but I don't know that the solution would be different? Thanks much!
I reduce the dired-buffer
clutter by hitting a (dired-find-alternate-file
) on subdirectories, rather than RET; that recycles the current dired window.
http://www.emacswiki.org/emacs/dired-single.el
;;; dired-single.el --- Reuse the current dired buffer to visit another directory... ;;; Commentary: ;; ;; This package provides a way to reuse the current dired buffer to visit ;; another directory (rather than creating a new buffer for the new directory). ;; Optionally, it allows the user to specify a name that all such buffers will ;; have, regardless of the directory they point to...
Dired+ lets you do this optionally, and it lets you toggle it on/off anytime.
See also http://www.emacswiki.org/emacs/DiredReuseDirectoryBuffer.
Like this?
(defadvice dired-find-file (around kill-old-buffer activate)
"When navigate from one dired buffer to another, kill the old one."
(let ((old-buffer (current-buffer))
(new-buffer (dired-get-filename)))
ad-do-it
(kill-buffer old-buffer)
(switch-to-buffer new-buffer)
))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With