version_control.vim 726 B

1234567891011121314151617181920
  1. " Fugitive Autocommands
  2. if has("autocmd")
  3. " Fugitive - Go up to previous tree object while exploring git tree with '..'
  4. autocmd User fugitive
  5. \ if fugitive#buffer().type() =~# '^\%(tree\|blob\)$' |
  6. \ nnoremap <buffer> .. :edit %:h<CR> |
  7. \ endif
  8. " Fugitive - Delete buffers when they are not active
  9. autocmd BufReadPost fugitive://* set bufhidden=delete
  10. endif
  11. " Git commands with Fugitive
  12. nnoremap <silent> <Leader>gc :Gcommit -v<CR>
  13. nnoremap <silent> <Leader>gl :Glog<CR><CR>
  14. nnoremap <silent> <Leader>gap :Git add -p<CR>
  15. nnoremap <silent> <Leader>gs :Gstatus<CR>
  16. nnoremap <silent> <Leader>gd :Gdiff<CR>
  17. nnoremap <silent> <Leader>gb :Gblame<CR>
  18. nnoremap <silent> <Leader>grbc :Git rebase --continue<CR>