Skip to content

Instantly share code, notes, and snippets.

@hlissner

hlissner/git-gutter.el

Last active Sep 13, 2020
Embed
What would you like to do?
My Emacs git-gutter configuration, paraphrased
(defconst doom-fringe-size '3 "Default fringe width")
;;; Setting up the fringe
;; switches order of fringe and margin
(setq-default fringes-outside-margins t)
;; standardize fringe width
(fringe-mode doom-fringe-size)
(push `(left-fringe . ,doom-fringe-size) default-frame-alist)
(push `(right-fringe . ,doom-fringe-size) default-frame-alist)
;;; Setting up git-gutter
(require 'git-gutter)
(require 'git-gutter-fringe)
;; colored fringe "bars"
(define-fringe-bitmap 'git-gutter-fr:added
[224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224]
nil nil 'center)
(define-fringe-bitmap 'git-gutter-fr:modified
[224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224]
nil nil 'center)
(define-fringe-bitmap 'git-gutter-fr:deleted
[0 0 0 0 0 0 0 0 0 0 0 0 0 128 192 224 240 248]
nil nil 'center)
;; Bootstrap
(add-hook 'text-mode 'git-gutter-mode)
(add-hook 'prog-mode 'git-gutter-mode)
(add-hook 'conf-mode 'git-gutter-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.