Next: , Up: Omitting Files in Dired   [Contents][Index]

3.1 Omitting Variables

The following variables can be used to customize omitting.

Variable: dired-omit-mode

If non-nil, “uninteresting” files are not listed. The default is nil. Uninteresting files are files whose names match regexp dired-omit-files, plus files whose names end with extension in dired-omit-extensions. C-x M-o (dired-omit-mode) toggles its value, which is buffer-local. Put

(dired-omit-mode 1)

inside your dired-mode-hook to have omitting initially turned on in every Dired buffer (see Installation). You can then use C-x M-o to unomit in that buffer.

To enable omitting automatically only in certain directories you can add a directory local setting (see Directory Variables in The GNU Emacs manual) for Dired mode

((dired-mode . ((dired-omit-mode . t))))

to a .dir-locals.el file in that directory. You can use the command add-dir-local-variable to do this.

Variable: dired-omit-files

This buffer-local variable’s value is a regexp, a string. Files whose names match this regexp will not be displayed. This only has effect when dired-omit-mode’s value is t.

The default value omits the special directories . and .. and autosave files (plus other files ending in .) (see Omitting Examples).

Variable: dired-omit-extensions

If non-nil, this variable’s value is a list of extensions (strings) to omit from Dired listings. Its format is the same as that of completion-ignored-extensions. The default value is the elements of completion-ignored-extensions, dired-latex-unclean-extensions, dired-bibtex-unclean-extensions and dired-texinfo-unclean-extensions.

Variable: dired-omit-case-fold

Default: filesystem This variable controls whether file-name matching is case-insensitive. By default, when dired-omit-case-fold is set to filesystem, dired-omit-mode will match filenames and extensions case-sensitively on Dired buffers visiting case-sensitive filesystems, and case-insensitively on case-insensitive filesystems. Set it to nil to be always case-sensitive, and to t to be always case-insensitive.

Variable: dired-omit-localp

This variable determines the localp argument dired-omit-expunge passes to dired-get-filename. If it is no-dir, the default, omitting is much faster, but you can only match against the non-directory part of the file name. Set it to nil if you need to match the whole file name or t to match the file name relative to the buffer’s top-level directory.

Variable: dired-omit-marker-char

Temporary marker used by Dired to implement omitting. Should never be used as marker by the user or other packages. There is one exception to this rule: by adding

(setq dired-mark-keys "\C-o")
;; i.e., the value of dired-omit-marker-char
;; (which is not defined yet)

to your ~/.emacs, you can bind the C-o key to insert a C-o marker, thus causing these files to be omitted in addition to the usually omitted files. Unfortunately the files you omitted manually this way will show up again after reverting the buffer, unlike the others. The default value is C-o.

Next: , Up: Omitting Files in Dired   [Contents][Index]