diff --git a/README.md b/README.md index d5782c6..19bef8c 100644 --- a/README.md +++ b/README.md @@ -358,6 +358,44 @@ Here are some example uses: (dired-rainbow-define-chmod executable-unix "Green" "-[rw-]+x.*") ``` +Putting it all together, the following is a basic setup (essentially a +pseudo-port of [LS_COLORS](https://github.com/trapd00r/LS_COLORS) +obtained by inspecting a terminal and approximating colors with +[Tailwind CSS](https://tailwindcss.com/docs/colors/)). + +```scheme +(use-package dired-rainbow + :config + (progn + (dired-rainbow-define-chmod directory "#6cb2eb" "d.*") + (dired-rainbow-define html "#eb5286" ("css" "less" "sass" "scss" "htm" "html" "jhtm" "mht" "eml" "mustache" "xhtml")) + (dired-rainbow-define xml "#f2d024" ("xml" "xsd" "xsl" "xslt" "wsdl" "bib" "json" "msg" "pgn" "rss" "yaml" "yml" "rdata")) + (dired-rainbow-define document "#9561e2" ("docm" "doc" "docx" "odb" "odt" "pdb" "pdf" "ps" "rtf" "djvu" "epub" "odp" "ppt" "pptx")) + (dired-rainbow-define markdown "#ffed4a" ("org" "etx" "info" "markdown" "md" "mkd" "nfo" "pod" "rst" "tex" "textfile" "txt")) + (dired-rainbow-define database "#6574cd" ("xlsx" "xls" "csv" "accdb" "db" "mdb" "sqlite" "nc")) + (dired-rainbow-define media "#de751f" ("mp3" "mp4" "MP3" "MP4" "avi" "mpeg" "mpg" "flv" "ogg" "mov" "mid" "midi" "wav" "aiff" "flac")) + (dired-rainbow-define image "#f66d9b" ("tiff" "tif" "cdr" "gif" "ico" "jpeg" "jpg" "png" "psd" "eps" "svg")) + (dired-rainbow-define log "#c17d11" ("log")) + (dired-rainbow-define shell "#f6993f" ("awk" "bash" "bat" "sed" "sh" "zsh" "vim")) + (dired-rainbow-define interpreted "#38c172" ("py" "ipynb" "rb" "pl" "t" "msql" "mysql" "pgsql" "sql" "r" "clj" "cljs" "scala" "js")) + (dired-rainbow-define compiled "#4dc0b5" ("asm" "cl" "lisp" "el" "c" "h" "c++" "h++" "hpp" "hxx" "m" "cc" "cs" "cp" "cpp" "go" "f" "for" "ftn" "f90" "f95" "f03" "f08" "s" "rs" "hi" "hs" "pyc" ".java")) + (dired-rainbow-define executable "#8cc4ff" ("exe" "msi")) + (dired-rainbow-define compressed "#51d88a" ("7z" "zip" "bz2" "tgz" "txz" "gz" "xz" "z" "Z" "jar" "war" "ear" "rar" "sar" "xpi" "apk" "xz" "tar")) + (dired-rainbow-define packaged "#faad63" ("deb" "rpm" "apk" "jad" "jar" "cab" "pak" "pk3" "vdf" "vpk" "bsp")) + (dired-rainbow-define encrypted "#ffed4a" ("gpg" "pgp" "asc" "bfe" "enc" "signature" "sig" "p12" "pem")) + (dired-rainbow-define fonts "#6cb2eb" ("afm" "fon" "fnt" "pfb" "pfm" "ttf" "otf")) + (dired-rainbow-define partition "#e3342f" ("dmg" "iso" "bin" "nrg" "qcow" "toast" "vcd" "vmdk" "bak")) + (dired-rainbow-define vc "#0074d9" ("git" "gitignore" "gitattributes" "gitmodules")) + (dired-rainbow-define-chmod executable-unix "#38c172" "-.*x.*") + )) +``` + +*Note*: the [256 color cheat +sheet](https://jonasjacek.github.io/colors/) includes conversion from +the Xterm colors used by LS_COLORS to the HEX codes used by +`dired-rainbow`. Using that conversion an enterprising individual with a grasp of `sed`/`awk` could put together a +*real* port of [LS_COLORS](https://github.com/trapd00r/LS_COLORS) to `dired-rainbow`. + ### Related packages There is a related package called [diredfl](https://github.com/purcell/diredfl/) which extracts the extra fontification rules from Dired+ and packages them in a modern Emacsy way. They enhance things like the date face, permissions face and similar. Check it out!