mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 06:43:51 -05:00
@@ -81,6 +81,15 @@ that are part of Git repositories).
|
|||||||
*fugitive-:Gpull*
|
*fugitive-:Gpull*
|
||||||
:Gpull [args] Like |:Gmerge|, but for git-pull.
|
:Gpull [args] Like |:Gmerge|, but for git-pull.
|
||||||
|
|
||||||
|
*fugitive-:Gpush*
|
||||||
|
:Gpush [args] Invoke git-push, load the results into the quickfix
|
||||||
|
list, and invoke |:cwindow| to reveal any errors.
|
||||||
|
|:Dispatch| is used if available for asynchronous
|
||||||
|
invocation.
|
||||||
|
|
||||||
|
*fugitive-:Gfetch*
|
||||||
|
:Gfetch [args] Like |:Gpush|, but for git-fetch.
|
||||||
|
|
||||||
*fugitive-:Ggrep*
|
*fugitive-:Ggrep*
|
||||||
:Ggrep [args] |:grep| with git-grep as 'grepprg'.
|
:Ggrep [args] |:grep| with git-grep as 'grepprg'.
|
||||||
|
|
||||||
|
|||||||
@@ -1531,6 +1531,35 @@ augroup fugitive_commit
|
|||||||
autocmd VimLeavePre,BufDelete COMMIT_EDITMSG execute s:sub(s:FinishCommit(), '^echoerr (.*)', 'echohl ErrorMsg|echo \1|echohl NONE')
|
autocmd VimLeavePre,BufDelete COMMIT_EDITMSG execute s:sub(s:FinishCommit(), '^echoerr (.*)', 'echohl ErrorMsg|echo \1|echohl NONE')
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
|
" Section: Gpush, Gfetch
|
||||||
|
|
||||||
|
call s:command("-nargs=? -bang -complete=custom,s:RemoteComplete Gpush execute s:Dispatch('<bang>', 'push '.<q-args>)")
|
||||||
|
call s:command("-nargs=? -bang -complete=custom,s:RemoteComplete Gfetch execute s:Dispatch('<bang>', 'fetch '.<q-args>)")
|
||||||
|
|
||||||
|
function! s:Dispatch(bang, args)
|
||||||
|
let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd'
|
||||||
|
let cwd = getcwd()
|
||||||
|
let [mp, efm, cc] = [&l:mp, &l:efm, get(b:, 'current_compiler', '')]
|
||||||
|
try
|
||||||
|
let b:current_compiler = 'git'
|
||||||
|
let &l:errorformat = s:common_efm
|
||||||
|
let &l:makeprg = g:fugitive_git_executable . ' ' . a:args
|
||||||
|
execute cd fnameescape(s:repo().tree())
|
||||||
|
if exists(':Make') == 2
|
||||||
|
noautocmd Make
|
||||||
|
else
|
||||||
|
silent noautocmd make!
|
||||||
|
redraw!
|
||||||
|
return 'call fugitive#cwindow()'
|
||||||
|
endif
|
||||||
|
return ''
|
||||||
|
finally
|
||||||
|
let [&l:mp, &l:efm, b:current_compiler] = [mp, efm, cc]
|
||||||
|
if empty(cc) | unlet! b:current_compiler | endif
|
||||||
|
execute cd fnameescape(cwd)
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Section: Gdiff
|
" Section: Gdiff
|
||||||
|
|
||||||
call s:command("-bang -bar -nargs=* -complete=customlist,s:EditComplete Gdiff :execute s:Diff('',<f-args>)")
|
call s:command("-bang -bar -nargs=* -complete=customlist,s:EditComplete Gdiff :execute s:Diff('',<f-args>)")
|
||||||
|
|||||||
Reference in New Issue
Block a user