I am following this wiki suggestion to set up Emacs so that, i can move forward and backwards in dired mode without creating new buffers.
Using the a
key together with the (put 'dired-find-alternate-file 'disabled nil)
setting allows me to move into directories without new buffers.
But the hook for the ^
key mentioned in the wiki is not working for me. Going to previous directory with ^
still opens new buffers.
Here are the settings I am using in my .emacs.d/init.el
; dired settings
(require 'dired-x)
(setq dired-omit-files "^\\.?#\\|^\\.$\\|^\\.\\.$\\|^\\.")
(add-hook 'dired-mode-hook (lambda ()
(dired-omit-mode 1)))
(setq dired-listing-switches "-aBhl --group-directories-first")
(put 'dired-find-alternate-file 'disabled nil)
(add-hook 'dired-mode-hook
(lambda ()
(define-key dired-mode-map (kbd "^")
(lambda () (interactive) (find-alternate-file "..")))))
C-h k ^
you'll probably see that the default functiondired-up-directory
is still being called. Are the any error messages? I get errors when trying to loaddired-x
--Key sequence * O starts with non-prefix key *
define-key
keyboard shortcut is not getting recognized for some reason. If i typeM-x find-alternate-file
and then..
it goes back without creating new buffer. AlsoC-h k ^
shows that^
is bound todired-up-directory
. I do not get any errors though.