aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d/lisp/init-git.el
blob: 931f678d3bac4edff78dd77026119c77d2b058c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(when (gx/maybe-require-package 'magit)
  (autoload #'magit-status "magit-status" nil t))

(with-eval-after-load 'evil
  (evil-define-key 'normal 'global
    (kbd "<leader>gs") #'magit-status))

(setq magit-refresh-status-buffer nil)

(when (gx/maybe-require-package 'git-gutter)
  (autoload #'global-git-gutter-mode "git-gutter" nil t)
  (add-hook 'after-init-hook #'global-git-gutter-mode 'append))

(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 "<leader>gh") 'git-gutter:popup-hunk))

(provide 'init-git)