Add coc-git keybindings
This commit is contained in:
parent
46366c673a
commit
2c3d121344
22
nvim/coc
22
nvim/coc
@ -138,3 +138,25 @@ nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
|
|||||||
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
|
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
|
||||||
" Resume latest coc list.
|
" Resume latest coc list.
|
||||||
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
|
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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user