nvim: Remove mergetool and switch to DiffConflicts for git merge

Also add the conflict-marker plugin. This should also be useful
for doing rebases and resolving conflicts. Might drop one later
if one of them serves all the purposes in all cases.

While at it, add unimpaired style bindings for moving between
tabs. This is required since :DiffConflictsShowHistory opens
a new tab and default tab navigation bindings gt/gT at least
are binded to something else in python.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2020-05-03 11:39:29 +05:30
parent b42d4cc7a7
commit 534eebb89e
2 changed files with 9 additions and 15 deletions

View File

@ -13,8 +13,9 @@
[http]
sslVerify = false
[merge]
tool = vim_mergetool
tool = diffconflicts
conflictstyle=diff3
[mergetool "vim_mergetool"]
cmd = nvim -f -c "MergetoolStart" "$MERGED" "$BASE" "$LOCAL" "$REMOTE"
[mergetool "diffconflicts"]
cmd = nvim -c "DiffConflicts" "$MERGED" "$BASE" "$LOCAL" "$REMOTE"
trustExitCode = true
keepBackup = false

View File

@ -31,7 +31,7 @@ Plug 'lervag/vimtex'
Plug 'lambdalisue/gina.vim'
Plug 'airblade/vim-gitgutter'
Plug 'rhysd/git-messenger.vim'
Plug 'samoshkin/vim-mergetool'
Plug 'rhysd/conflict-marker.vim'
Plug 'whiteinge/diffconflicts'
" Boost vim command line mode
Plug 'vim-utils/vim-husk'
@ -236,6 +236,10 @@ nnoremap [b :bprevious<CR>
nnoremap ]b :bnext<CR>
nnoremap [B :bfirst<CR>
nnoremap ]B :blast<CR>
nnoremap [t :tabprevious<CR>
nnoremap ]t :tabnext<CR>
nnoremap [T :tabfirst<CR>
nnoremap ]T :tablast<CR>
nnoremap <Leader>b :b<SPACE>
nnoremap <Leader>bl :ls<CR>:b<SPACE>
nnoremap <Leader>bd :bd<SPACE>
@ -265,13 +269,6 @@ nnoremap <Leader>gB :Gina branch<SPACE>
nnoremap <Leader>go :Gina checkout<SPACE>
nnoremap <Leader>g- :Gina stash<CR>:e<CR>
nnoremap <Leader>g+ :Gina stash<SPACE>
" Git merge tool
nnoremap <Leader>ml :MergetoolDiffExchangeLeft<CR>
nnoremap <Leader>mr :MergetoolDiffExchangeRight<CR>
nnoremap <Leader>mu :MergetoolDiffExchangeUp<CR>
nnoremap <Leader>md :MergetoolDiffExchangeDown<CR>
nnoremap <Leader>mg :diffget<CR>
nnoremap <Leader>mp :diffput<CR>
" For gitgutter
nnoremap ]h :GitGutterNextHunk<CR>
nnoremap [h :GitGutterPrevHunk<CR>
@ -483,10 +480,6 @@ let g:loaded_perl_provider = 0
let g:loaded_node_provider = 0
let g:python3_host_prog = '/usr/bin/python3'
" Mergetool
let g:mergetool_layout = 'mr'
let g:mergetool_prefer_revision = 'unmodified'
" Floaterm
let g:floaterm_open_in_root = 0
let g:floaterm_position = 'center'