Skip to content

Instantly share code, notes, and snippets.

@arronmabrey
Last active May 10, 2019 07:51
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arronmabrey/344c40a9157e31544d76f092b70a4809 to your computer and use it in GitHub Desktop.
Save arronmabrey/344c40a9157e31544d76f092b70a4809 to your computer and use it in GitHub Desktop.
Config git-gutter with linum in Spacemacs
(defun dotspacemacs/layers ()
(setq-default
dotspacemacs-configuration-layers
'((version-control :variables
version-control-global-margin t
version-control-diff-tool 'git-gutter
))))
(defun dotspacemacs/init ()
(setq-default
;; Enable global line-numbers
dotspacemacs-line-numbers 'relative
))
(defun dotspacemacs/user-config ()
(progn
;; Linum
;; NOTE: the "relative" flag for "dotspacemacs-line-numbers 'relative"
;; doesn't seem to be working, so we add the hooks here manually
(when (eq dotspacemacs-line-numbers 'relative)
(add-hook 'prog-mode-hook 'linum-relative-mode)
(add-hook 'text-mode-hook 'linum-relative-mode))
(setq-default
linum-format "%4d \u2502"
linum-relative-format "%4s \u2502"
))
(progn
;; Git Gutter
(set-face-attribute
'git-gutter:added nil :background nil :foreground "green")
(set-face-attribute
'git-gutter:deleted nil :background nil :foreground "red")
(set-face-attribute
'git-gutter:modified nil :background nil :foreground "blue")
(setq-default
git-gutter:modified-sign "!"
))
)
@arronmabrey
Copy link
Author

@roman
Copy link

roman commented May 18, 2018

What is the face you use to have the current line with a grayed-out yellow? I like it, thanks for this btw, it worked like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment