Pergunta

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?

Foi útil?

Solução

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
 ))
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top