-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit-gitgutter.el
31 lines (25 loc) · 1.41 KB
/
init-gitgutter.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
(require 'git-gutter+)
(require 'git-gutter-fringe+)
;; neutral ish colors (for zenburn at least)
(set-face-attribute 'git-gutter-fr+-added nil :foreground "#5b8258")
(set-face-attribute 'git-gutter-fr+-deleted nil :foreground "#965555")
(set-face-attribute 'git-gutter-fr+-modified nil :foreground "#936b91")
(global-git-gutter+-mode t)
;; (git-gutter-fr+-minimal) ;; <- minimal theme, grayish colors
;; hotkeys
(eval-after-load 'git-gutter+
'(progn
;;; Jump between hunks
(define-key git-gutter+-mode-map (kbd "C-c C-v C-n") 'git-gutter+-next-hunk)
(define-key git-gutter+-mode-map (kbd "C-c C-v C-p") 'git-gutter+-previous-hunk)
;;; Act on hunks
(define-key git-gutter+-mode-map (kbd "C-c C-v C-=") 'git-gutter+-show-hunk)
(define-key git-gutter+-mode-map (kbd "C-c C-v C-r") 'git-gutter+-revert-hunks)
;; Stage hunk at point.
;; If region is active, stage all hunk lines within the region.
(define-key git-gutter+-mode-map (kbd "C-c C-v C-s") 'git-gutter+-stage-hunks)
(define-key git-gutter+-mode-map (kbd "C-c C-v C-c") 'git-gutter+-commit)
;; (define-key git-gutter+-mode-map (kbd "C-c C-v C-C") 'git-gutter+-stage-and-commit)
(define-key git-gutter+-mode-map (kbd "C-c C-v C-b") 'git-gutter+-stage-and-commit-whole-buffer)
(define-key git-gutter+-mode-map (kbd "C-c C-v C-u") 'git-gutter+-unstage-whole-buffer)))
(add-to-list 'git-gutter+-disabled-modes 'org-mode)