" Fugitive Autocommands if has("autocmd") " Fugitive - Go up to previous tree object while exploring git tree with '..' autocmd User fugitive \ if fugitive#buffer().type() =~# '^\%(tree\|blob\)$' | \ nnoremap .. :edit %:h | \ endif " Fugitive - Delete buffers when they are not active autocmd BufReadPost fugitive://* set bufhidden=delete endif " Search for conflict markers nnoremap c /\v^[<\|=>]{7}( .*\|$) " Git commands with Fugitive nnoremap gc :Gcommit -v nnoremap gl :Glog nnoremap gap :Git add -p nnoremap gs :Gstatus nnoremap gd :Gdiff nnoremap gb :Gblame " Get what's changed in an as-yet-unsaved file if !exists(':DiffOrig') command DiffOrig vert new | set buftype=nofile | read ++edit # | 0d_ \ | diffthis | wincmd p | diffthis endif