mirror of
https://github.com/amix/vimrc
synced 2025-06-23 06:35:01 +08:00
Updated plugins
This commit is contained in:
@ -215,6 +215,7 @@ By default the signs are updated as follows:
|
||||
| Switch buffer | To notice change to git index | `g:gitgutter_eager` |
|
||||
| Switch tab | To notice change to git index | `g:gitgutter_eager` |
|
||||
| Focus the GUI | To notice change to git index | `g:gitgutter_eager` (not gVim on Windows) |
|
||||
| After shell command | To notice change to git index | `g:gitgutter_eager` |
|
||||
| Read a file into a buffer | To display initial signs | [always] |
|
||||
| Save a buffer | So non-realtime signs are up to date | [always] |
|
||||
| Change a file outside Vim | To notice `git stash` | [always] |
|
||||
@ -338,11 +339,11 @@ See above for configuring maps for hunk-jumping and staging/undoing.
|
||||
|
||||
#### Use a custom `grep` command
|
||||
|
||||
If you use an alternative to grep, or your grep does not support the `color` flag, you can tell vim-gitgutter to use it here. It only needs to support extended POSIX regex.
|
||||
If you use an alternative to grep, you can tell vim-gitgutter to use it here.
|
||||
|
||||
```viml
|
||||
" Default:
|
||||
let g:gitgutter_grep_command = 'grep --color=never -e'
|
||||
let g:gitgutter_grep_command = 'grep'
|
||||
```
|
||||
|
||||
#### To turn off vim-gitgutter by default
|
||||
@ -526,7 +527,7 @@ Here are some things you can check:
|
||||
* Your git config is compatible with the version of git returned by the command above.
|
||||
* Your Vim supports signs (`:echo has('signs')` should give `1`).
|
||||
* Your file is being tracked by git and has unstaged changes.
|
||||
* If your grep does not support the `color` flag, add `let g:gitgutter_grep_command = 'grep -e'` to your `~/.vimrc`.
|
||||
* If you have aliased or configured `grep` to use any flags, add `let g:gitgutter_grep_command = 'grep'` to your `~/.vimrc`.
|
||||
|
||||
|
||||
### Shameless Plug
|
||||
|
@ -4,7 +4,10 @@ if exists('g:gitgutter_grep_command')
|
||||
else
|
||||
let s:grep_available = executable('grep')
|
||||
if s:grep_available
|
||||
let s:grep_command = 'grep --color=never -e'
|
||||
let s:grep_command = 'grep'
|
||||
if $GREP_OPTIONS =~# '--color=always'
|
||||
let s:grep_command .= ' --color=never'
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
let s:hunk_re = '^@@ -\(\d\+\),\?\(\d*\) +\(\d\+\),\?\(\d*\) @@'
|
||||
|
@ -274,7 +274,7 @@ TO USE A CUSTOM GREP COMMAND
|
||||
|
||||
To use a custom invocation for grep, use this:
|
||||
>
|
||||
let g:gitgutter_grep_command = 'grep --color=never -e'
|
||||
let g:gitgutter_grep_command = 'grep'
|
||||
<
|
||||
|
||||
TO TURN OFF VIM-GITGUTTER BY DEFAULT
|
||||
|
@ -196,30 +196,17 @@ augroup gitgutter
|
||||
endif
|
||||
|
||||
if g:gitgutter_eager
|
||||
autocmd BufWritePost,FileChangedShellPost * call gitgutter#process_buffer(bufnr(''), 0)
|
||||
|
||||
" When you enter a new tab, BufEnter is only fired if the buffer you enter
|
||||
" is not the one you came from.
|
||||
"
|
||||
" For example:
|
||||
"
|
||||
" `:tab split` fires TabEnter but not BufEnter.
|
||||
" `:tab new` fires TabEnter and BufEnter.
|
||||
"
|
||||
" As and when both TabEnter and BufEnter are fired, we do not want to
|
||||
" process the entered buffer twice. We avoid this by setting and clearing
|
||||
" a flag.
|
||||
autocmd BufWritePost,FileChangedShellPost,ShellCmdPost * call gitgutter#process_buffer(bufnr(''), 0)
|
||||
|
||||
autocmd BufEnter *
|
||||
\ if gettabvar(tabpagenr(), 'gitgutter_didtabenter') |
|
||||
\ call settabvar(tabpagenr(), 'gitgutter_didtabenter', 0) |
|
||||
\ call gitgutter#all() |
|
||||
\ else |
|
||||
\ call gitgutter#process_buffer(bufnr(''), 0) |
|
||||
\ endif
|
||||
|
||||
autocmd TabEnter *
|
||||
\ call settabvar(tabpagenr(), 'gitgutter_didtabenter', 1) |
|
||||
\ call gitgutter#all()
|
||||
autocmd TabEnter * call settabvar(tabpagenr(), 'gitgutter_didtabenter', 1)
|
||||
|
||||
if !has('gui_win32')
|
||||
autocmd FocusGained * call gitgutter#all()
|
||||
|
Reference in New Issue
Block a user