From 5f10746c3cea49046eb9385e80447e3354477795 Mon Sep 17 00:00:00 2001 From: Howard Huang Date: Wed, 17 Mar 2021 05:44:53 -0700 Subject: [PATCH] Add GitGutter/GitSigns highlighting (#234) This adds specific highlight groups for GitGutter-related things. It piggybacks off of the `Diff*` highlight groups. The `gitsigns.nvim` maintainer [suggested](https://github.com/lewis6991/gitsigns.nvim/issues/94) that this be implemented by checking if neovim is >= version 0.5, and if the package is available (as opposed to a variable like `g:loaded_gitsigns`). This is because `gitsigns` is essentially lazy-loaded so checking the variable when Dracula loads might be too early. See these other related links in from [gitsigns](https://github.com/lewis6991/gitsigns.nvim): https://github.com/lewis6991/gitsigns.nvim/issues/54 https://github.com/lewis6991/gitsigns.nvim/commit/317750d66a572588eef9a23fefce4aff1cbcad94 --- after/plugin/dracula.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/after/plugin/dracula.vim b/after/plugin/dracula.vim index ff932a5..61eaf5c 100644 --- a/after/plugin/dracula.vim +++ b/after/plugin/dracula.vim @@ -41,6 +41,26 @@ if exists('g:loaded_ctrlp') hi! link CtrlPBufferHid Normal endif " }}} +" GitGutter / gitsigns: {{{ +if exists('g:loaded_gitgutter') + hi! link GitGutterAdd DiffAdd + hi! link GitGutterChange DiffChange + hi! link GitGutterDelete DiffDelete +endif +if has('nvim-0.5') && luaeval("pcall(require, 'gitsigns')") + " https://github.com/lewis6991/gitsigns.nvim requires nvim > 0.5 + " has('nvim-0.5') checks >= 0.5, so this should be future-proof. + hi! link GitSignsAdd DiffAdd + hi! link GitSignsAddLn DiffAdd + hi! link GitSignsAddNr DiffAdd + hi! link GitSignsChange DiffChange + hi! link GitSignsChangeLn DiffChange + hi! link GitSignsChangeNr DiffChange + hi! link GitSignsDelete DiffDelete + hi! link GitSignsDeleteLn DiffDelete + hi! link GitSignsDeleteNr DiffDelete +endif +" }}} " Tree-sitter: {{{ if exists('g:loaded_nvim_treesitter') " # Misc