Note on git-gutter in Doom Emacs
The git-gutter and git-gutter-fr packages default to drawing bitmaps for the indicators they display (e.g. bitmap of a plus sign for added lines). In Doom Emacs, these bitmaps are replaced with contiguous lines which may look nicer, but require a change to the foreground of the relevant faces to yield the desired color combinations.
Since this is Doom-specific, we urge users to apply changes in their local setup. Below is some sample code, based on what we cover at length elsewhere in this manual:
Use theme colors in code with modus-themes-with-colors.
emacs-lisp
(defun my-modus-themes-custom-faces (&rest _)
(modus-themes-with-colors
(custom-set-faces
;; Make foreground the same as background for a uniform bar on
;; Doom Emacs.
;;
;; Doom should not be implementing such hacks because themes
;; cannot support them:
;; <https://protesilaos.com/codelog/2022-08-04-doom-git-gutter-modus-themes/>.
`(git-gutter-fr:added ((,c :foreground ,bg-added-fringe)))
`(git-gutter-fr:deleted ((,c :foreground ,bg-removed-fringe)))
`(git-gutter-fr:modified ((,c :foreground ,bg-changed-fringe))))))
(add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces)Using a hook at the post-load-theme phase.
As always, re-load the theme for changes to take effect.
If the above does not work, try this instead:
emacs-lisp
(after! modus-themes
(modus-themes-with-colors
(custom-set-faces
;; Make foreground the same as background for a uniform bar on
;; Doom Emacs.
;;
;; Doom should not be implementing such hacks because themes
;; cannot support them:
;; <https://protesilaos.com/codelog/2022-08-04-doom-git-gutter-modus-themes/>.
`(git-gutter-fr:added ((,c :foreground ,bg-added-intense)))
`(git-gutter-fr:deleted ((,c :foreground ,bg-removed-intense)))
`(git-gutter-fr:modified ((,c :foreground ,bg-changed-intense))))))