1

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?

a_subscriber
  • 4,062
  • 1
  • 18
  • 56

1 Answers1

7

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.

xuchunyang
  • 14,527
  • 1
  • 19
  • 39