/diredful

Colorful file names in dired buffers

Primary LanguageEmacs Lisp

Diredful.el provides a simple UI for customizing dired mode to use different faces and colors. Faces are chosen based on file extension, file name, or a regexp matching the file line.

Screenshots available at EmacsWiki.

Install https://stable.melpa.org/packages/diredful-badge.svg https://melpa.org/packages/diredful-badge.svg

Using Melpa:

M-x package-install RET diredful RET

Then to activate by default, add the following into your init file (customizing this variable will not work):

(diredful-mode 1)

For manual installation, put diredful.el in your Emacs-Lisp load path, and add this to your init file:

(require 'diredful)
(diredful-mode 1)

Usage

Do:

M-x diredful-add

This will ask you to define a new name for a file type, like “images”. You can then specify a list of extensions or file names that belong to this type and customize the face used to display them. A new face will be automatically generated and updated for each type.

Note: changes will only be applied to newly created dired buffers.

File Types can be added, edited, and deleted using the following commands:

M-x diredful-add
M-x diredful-delete
M-x diredful-edit
M-x diredful-edit-file-at-point

These settings will be saved to the location of diredful-init-file (the default is “~/.emacs.d/diredful-conf.el”). You may choose a different location by doing:

M-x customize-variable RET diredful-init-file

Tips

File type names are sorted alphabetically before being applied. If two file types matched the same file, the file type that comes last in an alphabetically-sorted list will take precedence (e.g., a type named “zworldwritable” will take priority over other types).

The world-writable regexp pattern used in the screenshot is [rwx-][rwx-][rwx-][rwx-][rwx-][rwx-][rwx-]w[trwx-].