-
Notifications
You must be signed in to change notification settings - Fork 0
/
fugitiverc.vim
33 lines (30 loc) · 950 Bytes
/
fugitiverc.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
nnoremap <leader>gs :Git<CR>
nnoremap <leader>gc :Git commit -v -q<CR>
nnoremap <leader>ga :Git add .
nnoremap <leader>gt :Git commit -v -q %<CR>
nnoremap <leader>gd :Gdiff<CR>
nnoremap <leader>ge :Gedit<CR>
nnoremap <leader>gr :Gread<CR>
nnoremap <leader>gw :Gwrite<CR><CR>
nnoremap <leader>gl :Git log --oneline -1000<CR>
nnoremap <leader>gp :Ggrep<Space>
nnoremap <leader>gm :Gmove<Space>
nnoremap <leader>gb :Git branch<Space>
nnoremap <leader>go :Git checkout<Space>
nnoremap <leader>gps :Git push<CR>
nnoremap <leader>gpl :Git pull<CR>
function! s:BlameToggle() abort
let found = 0
for winnr in range(1, winnr('$'))
if getbufvar(winbufnr(winnr), '&filetype') ==# 'fugitiveblame'
exe winnr . 'close'
let found = 1
endif
endfor
if !found
Git blame
endif
endfunction
nnoremap <silent> <leader>bl :call <SID>BlameToggle()<CR>
command Glog :Git log --oneline --decorate --graph -500
command Greview :Gclog @ ^!