Clarify how signs' colours are derived.

This commit is contained in:
Andy Stewart
2019-02-17 07:10:48 +00:00
parent fd834e48ee
commit 3ce2a4be25

View File

@@ -270,7 +270,11 @@ endif
#### Signs' colours and symbols
To customise the colours, set up the following highlight groups in your colorscheme or `~/.vimrc`:
By default vim-gitgutter uses your colourscheme's `Diff*` highlight groups' foreground colours for the signs' foreground colours. For example, your `DiffAdd` foreground colour will be used for the `+` sign's foreground colour.
The signs' background colours will all be set to the sign column's background colour.
If you don't like the default colours, you can either fix your colourscheme's `Diff*` highlights or configure your own `GitGutter*` highlight groups. These groups are:
```viml
GitGutterAdd " an added line (default: links to DiffAdd)
@@ -281,6 +285,16 @@ GitGutterChangeDelete " a changed line followed by at least one removed line (de
You can either set these with `highlight GitGutterAdd {key}={arg}...` or link them to existing highlight groups with, say, `highlight link GitGutterAdd MyDiffAdd`.
To get vim-gitgutter's original colours (based on git-diff's colours in my terminal):
```viml
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 would replace `<X>` and `<Y>` with 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`.
To customise the symbols, add the following to your `~/.vimrc`:
```viml