Trying here to set color for executable files, as it is for ls command!
How can I do that?
I've already managed to set color for certains file extensions, using Diredful package, but couldn't do it according to it's mode!
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
Define "executable file" and a file's "mode".
If you mean something that
ls recognizes as executable and flags as such, with an asterisk (
*), when you use
F, then Dired+ highlights that. It uses face `` for the asterisk.
;; For this to show up, you need `F' among the options in `dired-listing-switches'. ;; For example, I use "-alF" for `dired-listing-switches'. (defface diredp-executable-tag '((t (:foreground "Red"))) "Face used for executable tag (*) on file names in Dired buffers." :group 'Dired-Plus :group 'font-lock-highlighting-faces)
For a non-dired-plus version, I use this code to highlight executable files in
dired-mode by using the face
helm-ff-executable (it can be changed to any other face up to preference):
(add-to-list 'dired-font-lock-keywords (list dired-re-exe '(".+" (dired-move-to-filename) nil (0 'helm-ff-executable))) 'append)