I use the following code in .emacs
:
(require 'dired+)
(toggle-diredp-find-file-reuse-dir 1)
So it won't create a buffer for every dir I visit. Then I decided to add some ergonomics:
(add-hook 'dired-mode-hook
(lambda ()
(define-key dired-mode-map (kbd "C-<up>") 'dired-up-directory)))
So when I click Ctrl-<up>
it will move to the parent directory. But it opens the parent dir in a new buffer.
How to make it open in the same buffer?
The solution can be found there:
(add-hook 'dired-mode-hook
(lambda ()
(define-key dired-mode-map (kbd "C-<up>")
(lambda () (interactive) (find-alternate-file "..")))
; was dired-up-directory
))
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