Use the Diff* highlight groups by default.

This change makes the plugin default to using the highlight groups
defined by the colorscheme instead of hardcoding its own foreground
colours.

If you liked the previous colours you can restore them by adding these
lines to your vimrc:

highlight GitGutterAdd    guifg=#009900 guibg=<X> ctermfg=2 ctermb=<Y>
highlight GitGutterChange guifg=#bbbb00 guibg=<X> ctermfg=3 ctermb=<Y>
highlight GitGutterDelete guifg=#ff2222 guibg=<X> ctermfg=1 ctermb=<Y>

– where you should replace <X> and <Y> are the background colour of your
SignColumn in the gui and the terminal respectively.

For example, with the solarized colorscheme and a dark background,
guibg=#073642 and ctermbg=0.

Closes #545, #560.
This commit is contained in:
Andy Stewart
2019-01-25 17:27:08 +00:00
parent faa1e953de
commit afa4f2ddf0
3 changed files with 21 additions and 15 deletions

View File

@@ -438,7 +438,7 @@ colorscheme or |vimrc|:
You can either set these with `highlight GitGutterAdd {key}={arg}...` or link
them to existing highlight groups with, say:
>
highlight link GitGutterAdd DiffAdd
highlight link GitGutterAdd MyDiffAdd
<
To change the line highlights, set up the following highlight groups in your
@@ -450,6 +450,11 @@ colorscheme or |vimrc|:
GitGutterChangeDeleteLine " default: links to GitGutterChangeLineDefault
<
For example, to use |hl-DiffText| instead of |hl-DiffChange|:
>
highlight link GitGutterChangeLine DiffChange
<
===============================================================================
FAQ *gitgutter-faq*