Add coc-git keybindings

This commit is contained in:
Daniel Lynn 2021-07-12 15:50:00 -05:00
parent 46366c673a
commit 2c3d121344

View File

@ -138,3 +138,25 @@ nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list.
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
" CoC-Git mappings
" navigate chunks of current buffer
nmap [h <Plug>(coc-git-prevchunk)
nmap ]h <Plug>(coc-git-nextchunk)
" navigate conflicts of current buffer
nmap [c <Plug>(coc-git-prevconflict)
nmap ]c <Plug>(coc-git-nextconflict)
" show chunk diff at current position
nmap gs <Plug>(coc-git-chunkinfo)
" show commit contains current position
nmap gc <Plug>(coc-git-commit)
" create text object for git chunks
omap ig <Plug>(coc-git-chunk-inner)
xmap ig <Plug>(coc-git-chunk-inner)
omap ag <Plug>(coc-git-chunk-outer)
xmap ag <Plug>(coc-git-chunk-outer)
" undo current chunk
nmap <Leader>hu :<C-u>CocCommand git.chunkUndo<CR>
nmap <Leader>hs :<C-u>CocCommand git.chunkStage<CR>
" git list
nnoremap <silent><nowait> <space>g :<C-u>CocList --normal gstatus<CR>