When I use dired
mode to browse around and find a file I want to open in Emacs, dired
opens a new buffer for each directory I visit when looking for the file each time I select a directory with Enter, which means I can end up with a lot of buffers I don't want:
. * newer 0 Fundamental c:/work/stackoverflow/batch/mydir/newer % mydir 302 Dired by name c:/work/stackoverflow/batch/mydir/ % batch 616 Dired by name c:/work/stackoverflow/batch/ % stackoverflow 1017 Dired by name c:/work/stackoverflow/ % work 2545 Dired by name c:/work/ * *scratch* 190 Lisp Interaction % *Completions* 162 Completion List * *Messages* 2163 Fundamental
Is there any way to make dired
re-use a single buffer? I tried M-x customize-group
for group dired
but didn't see anything promising in there.
Alternatively, does anyone have a macro to close all open dired
buffers?
Dired is the main mode for Emacs file-manager operations. The name “Dired” stands for “directory editor”. A single Dired buffer can display the contents of a single directory, or it can include listings of one or more sub-directories.
To enter into a directory, move to its listing in the Dired buffer, and simply hit the return key. To view a file, you can place the cursor on its entry and use the f or v key, or simply hit the return key.
Use a (dired-find-alternate-file
) instead of Enter
Also, see this page:
http://www.emacswiki.org/emacs/DiredReuseDirectoryBuffer
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