-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfugitiverc.vim
More file actions
42 lines (39 loc) · 1.19 KB
/
fugitiverc.vim
File metadata and controls
42 lines (39 loc) · 1.19 KB
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
34
35
36
37
38
39
40
41
42
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
let g:git_log_options = '-n 500'
nnoremap <silent> <leader>bl :call <SID>BlameToggle()<CR>
command Glog :Gclog -n 500
command Greview :Gclog @ ^!
augroup FugitiveGclog
autocmd!
if (has_key(plugs, "spaceduck"))
autocmd FileType git highlight link diffAdded DiffAdd
autocmd FileType git highlight link diffChanged DiffChange
autocmd FileType git highlight link diffRemoved DiffDelete
endif
augroup END