https://github.com/jixiuf/dired-filetype-face
set different face for different file types in dired buffer for emacs
https://github.com/jixiuf/dired-filetype-face
emacs-lisp melpa
Last synced: 4 months ago
JSON representation
set different face for different file types in dired buffer for emacs
- Host: GitHub
- URL: https://github.com/jixiuf/dired-filetype-face
- Owner: jixiuf
- Created: 2011-04-04T07:55:17.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2025-04-12T03:55:58.000Z (6 months ago)
- Last Synced: 2025-04-12T04:36:50.778Z (6 months ago)
- Topics: emacs-lisp, melpa
- Language: Emacs Lisp
- Homepage: http://www.emacswiki.org/emacs/DiredFileTypeFaces
- Size: 41 KB
- Stars: 14
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
dired-filetype-face
=================================[](http://melpa.org/#/dired-filetype-face)
Set different faces for different filetypes in dired
Getting started
------------The easiest way to get started is to install the package via [MELPA][melpa]:
[melpa]: http://melpa.org/
```elisp
(package-install 'dired-filetype-face)
```Once installed, activate it by adding the following to your `~/.emacs` startup
file:```elisp
(require 'dired-filetype-face)
```If you want to add a new face for new filetype(s):
```elisp
(deffiletype-face "mytype" "Chartreuse")
```then either:
```elisp
(deffiletype-face-regexp mytype
:extensions '("foo" "bar") :type-for-docstring "my type")
```to match all files ending either ".foo" or ".bar", or equivalently:
```elisp
(deffiletype-face-regexp mytype
:regexp "^ -.*\\.\\(foo\\|bar\\)$" :type-for-docstring "my type")
```and finally:
```elisp
(deffiletype-setup "mytype" "mytype")
```
The :regexp form allows you to specify other things to match on each line of
the dired buffer than (only) file extensions, such as the permission bits,
the size and the modification times.Pull Request for adding default extensions or changing current setting are welcome
------------------------Copyright & License
------------------------Copyright (C) 2011~2015, 纪秀峰. Released under the terms of the GNU GPL v3+.