How do I get Dired to not display certain files?

1

1

To start I'd like all *~ files to not be displayed in Dired.

EDIT: The below worked:

(add-hook 'dired-load-hook
      (lambda ()
        (load "dired-x")
        ;; Set dired-x global variables here.  For example:
        ;; (setq dired-guess-shell-gnutar "gtar")
        ;; (setq dired-x-hands-off-my-keys nil)
        ))
(setq dired-omit-files "^#\\|~$")
(add-hook 'dired-mode-hook
      (lambda ()
        ;; Set dired-x buffer-local variables here.  For example:
        (dired-omit-mode 1)
        ))

Loren

Posted 2011-05-03T00:26:15.173

Reputation: 317

Answers

2

Take a look at dired-omit mode:

Dired-Omit minor mode (indicator Omit):
Toggle Dired-Omit mode.
With numeric ARG, enable Dired-Omit mode if ARG is positive, disable
otherwise.  Enabling and disabling is buffer-local.
If enabled, "uninteresting" files are not listed.
Uninteresting files are those whose filenames match regexp `dired-omit-files',
plus those ending with extensions in `dired-omit-extensions'

dired-omit is part of dired-x.

Joe Casadonte

Posted 2011-05-03T00:26:15.173

Reputation: 3 945