15

More often than not, when I open a dired buffer, I press

  • ( to run dired-hide-details-mode

  • s to rundired-sort-toggle-or-edit

What's a good way to have these done automatically every time I open a dired buffer?

2
  • 4
    Use dired-mode-hook. Hooks are the standard way to perform mode-specific customizations.
    – Dan
    Oct 18, 2016 at 16:53
  • Thanks @Dan! I've added an answer based on your suggestion.
    – dharmatech
    Oct 18, 2016 at 17:02

1 Answer 1

15

Thanks to Dan's comment on the original question.

This seems to work:

(add-hook 'dired-mode-hook
      (lambda ()
        (dired-hide-details-mode)
        (dired-sort-toggle-or-edit)))
0

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.