version_control.vim 738 B

123456789101112131415161718192021
  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. nmap <silent> <Leader>gc :Gcommit -v<CR>
  13. "nmap <silent> <Leader>gl :Glog<CR><CR>
  14. nmap <silent> <Leader>gl :BCommits<CR>
  15. nmap <silent> <Leader>gap :Git add -p<CR>
  16. nmap <silent> <Leader>gs :Gstatus<CR>
  17. nmap <silent> <Leader>gd :Gdiff<CR>
  18. nmap <silent> <Leader>gb :Gblame<CR>
  19. nmap <silent> <Leader>grbc :Git rebase --continue<CR>