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
317750d66a
This commit is contained in:
Howard Huang 2021-03-17 05:44:53 -07:00 committed by GitHub
parent 561c21a962
commit 5f10746c3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,6 +41,26 @@ if exists('g:loaded_ctrlp')
hi! link CtrlPBufferHid Normal hi! link CtrlPBufferHid Normal
endif 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: {{{ " Tree-sitter: {{{
if exists('g:loaded_nvim_treesitter') if exists('g:loaded_nvim_treesitter')
" # Misc " # Misc