mirror of
https://github.com/amix/vimrc
synced 2025-06-29 02:55:01 +08:00
Updated plugins
This commit is contained in:
@ -283,6 +283,9 @@ You can customise:
|
||||
* How to handle non-gitgutter signs
|
||||
* The signs' colours and symbols
|
||||
* Line highlights
|
||||
* Line number highlights (only in Neovim 0.3.2 or higher)
|
||||
* The diff syntax colours used in the preview window
|
||||
* The intra-line diff highlights used in the preview window
|
||||
* Whether the diff is relative to the index (default) or working tree.
|
||||
* The base of the diff
|
||||
* Extra arguments for `git` when running `git diff`
|
||||
@ -395,6 +398,35 @@ highlight link GitGutterChangeLineNr Underlined
|
||||
```
|
||||
|
||||
|
||||
#### The diff syntax colours used in the preview window
|
||||
|
||||
To change the diff syntax colours used in the preview window, set up the `diff*` highlight groups in your colorscheme or `~/.vimrc`:
|
||||
|
||||
```viml
|
||||
diffAdded " if not set: use GitGutterAdd's foreground colour
|
||||
diffChanged " if not set: use GitGutterChange's foreground colour
|
||||
diffRemoved " if not set: use GitGutterDelete's foreground colour
|
||||
```
|
||||
|
||||
Note the `diff*` highlight groups are used in any buffer whose `'syntax'` is `diff`.
|
||||
|
||||
|
||||
#### The intra-line diff highlights used in the preview window
|
||||
|
||||
To change the intra-line diff highlights used in the preview window, set up the following highlight groups in your colorscheme or `~/.vimrc`:
|
||||
|
||||
```viml
|
||||
GitGutterAddIntraLine " default: gui=reverse cterm=reverse
|
||||
GitGutterDeleteIntraLine " default: gui=reverse cterm=reverse
|
||||
```
|
||||
|
||||
For example, to use `DiffAdd` for intra-line added regions:
|
||||
|
||||
```viml
|
||||
highlight link GitGutterAddIntraLine DiffAdd
|
||||
```
|
||||
|
||||
|
||||
#### Whether the diff is relative to the index or working tree
|
||||
|
||||
By default diffs are relative to the index. How you can make them relative to the working tree:
|
||||
|
@ -205,6 +205,10 @@ function! gitgutter#quickfix(current_file)
|
||||
elseif line =~ '^diff --git "'
|
||||
let [_, fnamel, _, fnamer] = split(line, '"')
|
||||
let fname = fnamel ==# fnamer ? fnamel : fnamel[2:]
|
||||
elseif line =~ '^diff --cc [^"]'
|
||||
let fname = line[10:]
|
||||
elseif line =~ '^diff --cc "'
|
||||
let [_, fname] = split(line, '"')
|
||||
elseif line =~ '^@@'
|
||||
let lnum = matchlist(line, '+\(\d\+\)')[1]
|
||||
elseif lnum > 0
|
||||
|
@ -109,8 +109,8 @@ function! gitgutter#highlight#define_highlights() abort
|
||||
highlight default link GitGutterChangeDeleteLineNr CursorLineNr
|
||||
|
||||
" Highlights used intra line.
|
||||
highlight GitGutterAddIntraLine gui=reverse cterm=reverse
|
||||
highlight GitGutterDeleteIntraLine gui=reverse cterm=reverse
|
||||
highlight default GitGutterAddIntraLine gui=reverse cterm=reverse
|
||||
highlight default GitGutterDeleteIntraLine gui=reverse cterm=reverse
|
||||
" Set diff syntax colours (used in the preview window) - diffAdded,diffChanged,diffRemoved -
|
||||
" to match the signs, if not set aleady.
|
||||
for [dtype,type] in [['Added','Add'], ['Changed','Change'], ['Removed','Delete']]
|
||||
|
@ -608,6 +608,26 @@ For example, to use |hl-Underlined| instead of |hl-CursorLineNr|:
|
||||
>
|
||||
highlight link GitGutterChangeLineNr Underlined
|
||||
<
|
||||
To change the diff syntax colours used in the preview window, set up the diff*
|
||||
highlight groups in your colorscheme or |vimrc|:
|
||||
>
|
||||
diffAdded " if not set: use GitGutterAdd's foreground colour
|
||||
diffChanged " if not set: use GitGutterChange's foreground colour
|
||||
diffRemoved " if not set: use GitGutterDelete's foreground colour
|
||||
<
|
||||
Note the diff* highlight groups are used in any buffer whose 'syntax' is
|
||||
"diff".
|
||||
|
||||
To change the intra-line diff highlights used in the preview window, set up
|
||||
the following highlight groups in your colorscheme or |vimrc|:
|
||||
>
|
||||
GitGutterAddIntraLine " default: gui=reverse cterm=reverse
|
||||
GitGutterDeleteIntraLine " default: gui=reverse cterm=reverse
|
||||
<
|
||||
For example, to use |hl-DiffAdd| for intra-line added regions:
|
||||
>
|
||||
highlight link GitGutterAddIntraLine DiffAdd
|
||||
<
|
||||
|
||||
|
||||
===============================================================================
|
||||
|
@ -296,8 +296,8 @@ augroup gitgutter
|
||||
autocmd ColorScheme * call gitgutter#highlight#define_highlights()
|
||||
|
||||
" Disable during :vimgrep
|
||||
autocmd QuickFixCmdPre *vimgrep* let g:gitgutter_enabled = 0
|
||||
autocmd QuickFixCmdPost *vimgrep* let g:gitgutter_enabled = 1
|
||||
autocmd QuickFixCmdPre *vimgrep* let [g:gitgutter_was_enabled, g:gitgutter_enabled] = [g:gitgutter_enabled, 0]
|
||||
autocmd QuickFixCmdPost *vimgrep* let g:gitgutter_enabled = g:gitgutter_was_enabled | unlet g:gitgutter_was_enabled
|
||||
augroup END
|
||||
|
||||
" }}}
|
||||
|
Reference in New Issue
Block a user