From 1d4d6e123c7972e439b54deba3653ff265006ada Mon Sep 17 00:00:00 2001 From: Rutherther Date: Tue, 2 Jul 2024 20:50:11 +0200 Subject: [PATCH] fix: git gutter not working in fringe, wrong init --- init.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/init.el b/init.el index ea60c9f993098b40cf17a5004580e805aa539a52..ae1b1d9f5dd5c1ead7ba3f11cdbfc22f4421b434 100644 --- a/init.el +++ b/init.el @@ -901,10 +901,13 @@ ;; :after magit ;; :config (magit-todos-mode 1)) -(my-use-package git-gutter +(my-use-package git-gutter-fringe :ensure t - :demand t - :after evil + :preface + (defun git-gutter-with-find-file (&rest args) + (global-git-gutter-mode t) + (remove-hook 'find-file-hook #'git-gutter-with-find-file)) + (add-hook 'find-file-hook #'git-gutter-with-find-file) :general (my-leader "g p" '(git-gutter:previous-hunk :wk "Previous hunk") @@ -916,9 +919,7 @@ "g v SPC" '(git-gutter:mark-hunk :wk "Mark hunk")) (normal "]d" '(git-gutter:next-hunk :wk "Next hunk") - "[d" '(git-gutter:previous-hunk :wk "Next hunk")) - :config - (global-git-gutter-mode 1)) + "[d" '(git-gutter:previous-hunk :wk "Next hunk"))) (my-use-package git-timemachine :ensure t