Vrokipal
Vrokipal

Reputation: 824

Identify files under VC in Emacs Dired

With a .emacs containing:

(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)

I can easily identify files from directories (without looking at the 'd' flag).

I would like to identify files that are under version control from those that aren't.

After spending quite some time with SVN and git Emacs modes, I concluded (perhaps hastily) that they are not ready for prime-time, or at least basic things remain necessary to be done from the command line (and so it's easier to do everything from the command line), but this one is particularly pesky.

Can you suggest a lightweight method for distinguishing the files under VC? (or, if not lightweight, provide a suitable .emacs config?)

Upvotes: 1

Views: 343

Answers (1)

rsm
rsm

Reputation: 2560

I think diff-hl package might be what you are looking for. It not only marks files that were changed, but also files that are not under VC control (in VC controlled directory).

Install it as usual (M-x package-install RET diff-hl) and then in init file:

(global-diff-hl-mode)     ; enables diff-hl for all buffers
(diff-hl-flydiff-mode)    ; diff-hl marks changes on the fly
(add-hook 'dired-mode-hook 'diff-hl-dired-mode)  ; adds diff-hl for dired mode

You need also fringe-mode enabled to make it work, but I think Emacs comes with it preinstalled. You can use menu Options > Show/Hide > Fringe to check if fringe is set to something else than None.

Oh and when it comes to VC (at least Git) support, I find magit satisfactory. It's too complicated for my needs (and I still didn't figured out how to clone or init repo, so I use dired and execute git init or clone on . - current dir), but it's realiable and does it job.

Upvotes: 1

Related Questions