version_control.vim 746 B

12345678910111213141516171819202122
  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. " Search for conflict markers
  12. nnoremap <leader>fc /\v^[<\|=>]{7}( .*\|$)<CR>
  13. " Git commands with Fugitive
  14. nnoremap <silent> <leader>gc :Gcommit -v<CR>
  15. nnoremap <silent> <leader>gl :Glog<CR><CR>
  16. nnoremap <silent> <leader>gap :Git add -p<CR>
  17. nnoremap <silent> <leader>gs :Gstatus<CR>
  18. nnoremap <silent> <leader>gd :Gdiff<CR>
  19. nnoremap <silent> <leader>gb :Gblame<CR>