I am using Windows 10 and Emacs 26.1.

Suppose I open some file:

Enter image description here

And now I want fast open dired mode. The result must be like this:

Enter image description here

I want to do this by ONE hotkey direct from a buffer. E.g. C-x j. Is it possible?


You can use dired-jump from the builtin dired-x.el. I have it bound to C-x C-j, you can setup your own key binding.

C-x C-j runs the command dired-jump (found in global-map), which is an interactive autoloaded compiled Lisp function in dired-x.el.

It is bound to C-x C-j.

(dired-jump &optional OTHER-WINDOW FILE-NAME)

Jump to Dired buffer corresponding to current buffer. If in a file, Dired the current directory and move to file's line. If in Dired already, pop up a level and goto old directory's line. In case the proper Dired file line cannot be found, refresh the dired buffer and try again. When OTHER-WINDOW is non-nil, jump to Dired buffer in other window. When FILE-NAME is non-nil, jump to its line in Dired. Interactively with prefix argument, read FILE-NAME.

  • Yes, this is the answer. But presumably the OP already knows about dired-jump, as he posted this question about it a couple weeks ago. – Drew Sep 22 '18 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.