From 5345309958cb7634138c4f67eb296fb17ca03b58 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Wed, 9 Oct 2024 14:36:46 -0400 Subject: [PATCH] feat(dirvish): configure `dirvish-vc` faces --- config.org | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index 32adb43..a0f73ec 100644 --- a/config.org +++ b/config.org @@ -4044,11 +4044,38 @@ The variable ~+workspaces-switch-project-function~ contains a function that is r (setq dirvish-default-layout '(1 0.15 0.45)) ;; Show nested directories - (pushnew! dirvish-attributes 'collapse) + (pushnew! dirvish-attributes 'collapse)) +#+end_src - ;; Set dirvish line highlight to something less blinding +*** Faces + +The faces that ~dirvish~ uses to indicate git changes are showing up as gray by default, and the face that it uses to highlight the current line is a bit bright. + +To fix the line highlight we can just configure the relevant face (~dirvish-hl-line~), but the faces used by =dirvish-vc= actually inherit from faces for a built-in emacs library =vc=, so it makes more sense to customize those instead. + +#+begin_src emacs-lisp +(after! dirvish (set-face-attribute 'dirvish-hl-line nil :inherit 'hl-line)) +(after! vc + (set-face-attribute 'vc-edited-state nil + :foreground (doom-color 'orange)) + (set-face-attribute 'vc-locally-added-state nil + :foreground (doom-color 'green)) + (set-face-attribute 'vc-conflict-state nil + :foreground (doom-color 'red)) + (set-face-attribute 'vc-needs-update-state nil + :foreground (doom-color 'red)) + (set-face-attribute 'vc-missing-state nil + :foreground (doom-color 'comments))) +(after! dirvish-vc + (set-face-attribute 'dirvish-vc-unregistered-face nil + :foreground (doom-color 'grey))) +#+end_src + +*** =dirvish-fd= + +#+begin_src emacs-lisp (after! dirvish-fd (setq dirvish-fd-program (if-let ((path (nix-build-out-path-gcroot "fd" "nixpkgs#fd")))