Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dired backward/forward function

Tags:

emacs

dired

I'm looking for a package the browser's "back" button for dired. i.e. some way to go back to a previously visited directory.

The usecase I have in mind is to traverse deeper into a directory tree after invoking ^ to to to a parent folder.

like image 776
event_jr Avatar asked Apr 03 '12 11:04

event_jr


2 Answers

Use q to just close the current window, and the last visited one will be here.

like image 152
Nicolas Dudebout Avatar answered Nov 06 '22 14:11

Nicolas Dudebout


I use a to drill down into directories, then rebind ^ to this to go back up:

(defun my-dired-up-dir ()
  "Go up a directory."
  (interactive)
  (let ((current-dir (dired-current-directory)))
    (find-alternate-file "..")
    (dired-goto-file current-dir)))

It goes up a directory and puts point on the directory you just came from (so you can a back down if you want). Perhaps not exactly what you want since it only works on one level, but might still be useful.

like image 27
scottfrazer Avatar answered Nov 06 '22 14:11

scottfrazer