nnoremap aa :GinStatus nnoremap ab GinBranch --all nnoremap al :GinLog nnoremap aL :GinLog -- % function! s:show_commit(opener) abort let l:commit = matchstr(getline('.'), '\<[a-fA-F0-9]\{7,}\>') if empty(l:commit) return endif execute printf('GinBuffer ++opener=%s show %s', a:opener, l:commit) endfunction function! s:my_gitrebase() abort nnoremap (my-gin-show-commit:edit) call show_commit('edit') nnoremap (my-gin-show-commit:split) call show_commit('split') nnoremap (my-gin-show-commit:vsplit) call show_commit('vsplit') nnoremap (my-gin-show-commit:edit) nnoremap g (my-gin-show-commit:vsplit) endfunction function! s:my_gitcommit() abort nnoremap GinStatus nnoremap GinStatus endfunction function! s:my_gin_status() abort nnoremap Gin commit -v nnoremap Gin commit -v nnoremap g Gin commit -v --amend nnoremap g Gin commit -v --amend nmap g (gin-action-edit:HEAD) setl cursorline endfunction function! s:my_gin_log() abort nnoremap (gin-action-show) (gin-action-show:emojify) nnoremap (gin-action-stat) \ (gin-action-yank:commit) \ GinBuffer diff --stat +~..+ nnoremap (gin-action-fixup:instant) (gin-action-fixup:instant-fixup) setl cursorline endfunction function! s:define_gin_local() abort command! -buffer -bar GinLocal execute printf('edit +%d', line('.')) gin#util#expand('%:p') endfunction augroup my-gin autocmd! autocmd User GinComponentPost redrawtabline autocmd FileType gitrebase silent! call s:my_gitrebase() autocmd FileType gitcommit silent! call s:my_gitcommit() autocmd FileType gin-status silent! call s:my_gin_status() autocmd FileType gin-log silent! call s:my_gin_log() autocmd BufReadCmd ginedit://* call s:define_gin_local() autocmd BufReadCmd gindiff://* call s:define_gin_local() autocmd BufReadCmd ginlog://* call s:define_gin_local() augroup END if executable('delta') let g:gin_diff_persistent_args = [ \ '++processor=delta --diff-highlight --keep-plus-minus-markers', \] endif let g:gin_log_persistent_args = [ \ '++emojify', \ '--pretty=%C(yellow)%h%C(reset)%C(auto)%d%C(reset) %s %C(cyan)@%an%C(reset) %C(magenta)[%ar]%C(reset)', \] let g:gin_proxy_apply_without_confirm = 1