| 12345678910111213141516171819202122232425262728 |
- " 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 <buffer> .. :edit %:h<CR> |
- \ endif
- " Fugitive - Delete buffers when they are not active
- autocmd BufReadPost fugitive://* set bufhidden=delete
- endif
- " Search for conflict markers
- nnoremap <Leader>c /\v^[<\|=>]{7}( .*\|$)<CR>
- " Git commands with Fugitive
- nnoremap <silent> <Leader>gc :Gcommit -v<CR>
- nnoremap <silent> <Leader>gl :Glog<CR><CR>
- nnoremap <silent> <Leader>gap :Git add -p<CR>
- nnoremap <silent> <Leader>gs :Gstatus<CR>
- nnoremap <silent> <Leader>gd :Gdiff<CR>
- nnoremap <silent> <Leader>gb :Gblame<CR>
- " 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
|