0

How do I bind the LEFT key to go to parent directory in dired mode?

I tried

(define-key dired-mode-map (kbd "<left>") #'dired-up-directory) 

but that didn't work.

1 Answer 1

1

It's unclear what you tried, but try this:

(define-key dired-mode-map (kbd "<left>") #'dired-up-directory)

Actually, the source text for your question shows that you tried that, but you need to wrap your source text with three backquotes or else indent it 4 spaces, for it to display correctly.

So if you did actually try the same code shown in my answer then the problem is likely how you tried to evaluate that code (or didn't try). The code itself looks fine, to me.

4
  • It's working now. I had the line inserted correctly, but in the wrong file. Many thanks.
    – balanga
    Commented Sep 21, 2023 at 15:41
  • Please consider deleting your question, in that case. Thx.
    – Drew
    Commented Sep 21, 2023 at 19:24
  • 1
    The answer to the question is clearly shown in the answer, so may be of benefit to someone looking for a solution.
    – balanga
    Commented Sep 22, 2023 at 4:59
  • Please accept the answer then.
    – NickD
    Commented Feb 20 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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