" Setting the following two variables adds quick and dirty support for " subversion let g:GitExecutable="git" let g:GitEditCommand="vsplit" let VCSCommandDisableAll=1 function! GitQuote(file) return "'" . a:file . "'" endfunction function! GitAdd() let ret = system(g:GitExecutable . " add " . GitQuote(expand("%")) ) echo ret endfunction function! GitDiff() let diff = system(g:GitExecutable . " diff " . GitQuote(expand("%")) ) if strlen(diff) == 0 echo "No Difference!" else echo diff endif endfunction function! GitCommit() normal mz let file = GitQuote(expand('%')) exec GitDiff() echo let message = input("commit note? ") if message == "" let message = "trivial change" endif echo system(g:GitExecutable . " commit -m " . GitQuote(message) . " " . file ) echo system(g:GitExecutable . " push") normal `z endfunction function! GitStatus() let file = GitQuote(expand('%')) echo system(g:GitExecutable . " stat " . file ) endfunction " do we have vcscommand.vim if ! exists("VCSCommandDisableAll") set statusline=%<%f\ %h%m%r%{VCSCommandGetStatusLine()}%=%-14.(%l,%c%V%)\ %P cabbr gita call VCSAdd() cabbr gitd call VCSDiff() cabbr gitc call VCSCommit() endif if exists('g:GitExecutable') command! -nargs=0 A :call GitAdd() command! -nargs=0 D :call GitDiff() command! -nargs=0 C :call GitCommit() command! -nargs=0 S :call GitStatus() endif