Fix magit and diff-hl setup

This commit is contained in:
larstvei 2025-04-19 16:02:25 +02:00
parent b40c72b5ac
commit 59fd42d8d3

View File

@ -639,25 +639,27 @@
* Version control * Version control
Magit is the best. [[https://magit.vc/][Magit]] is the best.
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; A Git porcelain inside Emacs. ;; A Git porcelain inside Emacs.
(use-package magit (use-package magit
:hook ((magit-pre-refresh . diff-hl-magit-pre-refresh)
(magit-post-refresh . diff-hl-magit-post-refresh))
:bind (:map custom-bindings-map ("C-c m" . magit-status))) :bind (:map custom-bindings-map ("C-c m" . magit-status)))
#+end_src #+end_src
Have some visual indication where there are uncommitted changes. Have some visual indication where there are uncommitted changes using
[[https://github.com/dgutov/diff-hl][~diff-hl~]]. In addition, ~diff-hl~ can be automatically updated when interacting
with Magit.
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; Highlight uncommitted changes using VC ;; Highlight uncommitted changes using VC
(use-package diff-hl (use-package diff-hl
:defer t :defer t
:hook ((magit-pre-refresh . diff-hl-magit-pre-refresh)
(magit-post-refresh . diff-hl-magit-post-refresh))
:config :config
(global-diff-hl-mode 1)) (global-diff-hl-mode 1))