2

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!

0

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 ls switch 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)
  • Would you know how I could install Dired+? As of Emacs 26 it doens't seems to be available in MELPA Stable! – Vasconcelos1914 Aug 8 at 23:51
  • See Dired+. The library is here: dired+.el. Put it in a directory that is in your load-path (user option), then put (require 'dired) in your init file. – Drew Aug 9 at 0:18
  • That just worked swiftly! But my problem I've solved with diredful-add, then named Type Name, which was Executables. In pattern I entered $*, to match those binaries with * at the end! And in Pattern Type just selected the last option, which was "Regexp on whole line (starting from the first permission column) including file name." So that way now I see the executable files highlighted in colors in Dired mode itself, and not only in Shell mode! – Vasconcelos1914 Aug 9 at 1:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.