mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-14 06:13:51 -05:00
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:
16
README.mkd
16
README.mkd
@@ -273,13 +273,13 @@ endif
|
||||
To customise the colours, set up the following highlight groups in your colorscheme or `~/.vimrc`:
|
||||
|
||||
```viml
|
||||
GitGutterAdd " an added line
|
||||
GitGutterChange " a changed line
|
||||
GitGutterDelete " at least one removed line
|
||||
GitGutterChangeDelete " a changed line followed by at least one removed line
|
||||
GitGutterAdd " an added line (default: links to DiffAdd)
|
||||
GitGutterChange " a changed line (default: links to DiffChange)
|
||||
GitGutterDelete " at least one removed line (default: links to DiffDelete)
|
||||
GitGutterChangeDelete " a changed line followed by at least one removed line (default: links to GitGutterChange)
|
||||
```
|
||||
|
||||
You can either set these with `highlight GitGutterAdd {key}={arg}...` or link them to existing highlight groups with, say, `highlight link GitGutterAdd DiffAdd`.
|
||||
You can either set these with `highlight GitGutterAdd {key}={arg}...` or link them to existing highlight groups with, say, `highlight link GitGutterAdd MyDiffAdd`.
|
||||
|
||||
To customise the symbols, add the following to your `~/.vimrc`:
|
||||
|
||||
@@ -303,6 +303,12 @@ GitGutterDeleteLine " default: links to DiffDelete
|
||||
GitGutterChangeDeleteLine " default: links to GitGutterChangeLineDefault, i.e. DiffChange
|
||||
```
|
||||
|
||||
For example, in some colorschemes the `DiffText` highlight group is easier to read than `DiffChange`. You could use it like this:
|
||||
|
||||
```viml
|
||||
highlight link GitGutterChangeLine DiffText
|
||||
```
|
||||
|
||||
|
||||
#### The base of the diff
|
||||
|
||||
|
||||
Reference in New Issue
Block a user