How open dired mode from any buffer by ONE hotkey?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



How open dired mode from any buffer by ONE hotkey?



windows 10, 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 buffer. E.g. C-x j.
Is it possible?


C-x j




1 Answer
1



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.


dired-jump


dired-x.el



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.


C-x C-j


dired-jump


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.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard