6

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
    Use dired-mode-hook. Hooks are the standard way to perform mode-specific customizations. – Dan Oct 18 '16 at 16:53
  • Thanks @Dan! I've added an answer based on your suggestion. – dharmatech Oct 18 '16 at 17:02
7

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)))

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.