From 7cec4a29e17865f93cd06eccf9d5ad87165ac198 Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Thu, 17 Mar 2022 21:42:23 +0800 Subject: Add git-gutter (emacs) --- .emacs.d/lisp/init-git.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.emacs.d/lisp/init-git.el b/.emacs.d/lisp/init-git.el index f7e4246..8a427dd 100644 --- a/.emacs.d/lisp/init-git.el +++ b/.emacs.d/lisp/init-git.el @@ -6,4 +6,16 @@ (setq magit-refresh-status-buffer nil) +(when (gx/maybe-require-package 'git-gutter) + (add-hook 'after-init-hook 'global-git-gutter-mode)) + +(with-eval-after-load 'git-gutter + (gx/diminish 'git-gutter-mode)) + +(with-eval-after-load 'evil + (evil-define-key 'normal 'git-gutter-mode + (kbd "]c") 'git-gutter:next-hunk + (kbd "[c") 'git-gutter:previous-hunk + (kbd "g") 'git-gutter:popup-hunk)) + (provide 'init-git) -- cgit v1.2.3