File tree Expand file tree Collapse file tree 3 files changed +24
-13
lines changed Expand file tree Collapse file tree 3 files changed +24
-13
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,13 @@ splitting them apart.
7777 git config --global mergetool.keepBackup false
7878 ```
7979
80+ Or, if you'd prefer to always open both the diff view and the history view
81+ call `DiffConflictsWithHistory` instead:
82+
83+ ```
84+ git config --global mergetool.diffconflicts.cmd 'vim -c DiffConflictsWithHistory "$MERGED" "$BASE" "$LOCAL" "$REMOTE"'
85+ ```
86+
80873. During a merge you can call `:DiffConflictsShowHistory` to open a new tab
8188 containing the merge BASE and full copies of the LOCAL and REMOTE versions
8289 of the conflicted file. This can help to understand the history or intent
Original file line number Diff line number Diff line change @@ -11,9 +11,16 @@ git config --global mergetool.diffconflicts.trustExitCode true
1111git config --global mergetool.keepBackup false
1212
1313Commands:
14+ :DiffConflicts
15+ Convert a file containing Git conflict markers into a two-way diff.
16+
1417:DiffConflictsShowHistory
1518 Open a new tab containing the merge base and the local and remote
1619 version of the conflicted file.
1720
21+ :DiffConflictsWithHistory
22+ Call both DiffConflicts and DiffConflictsShowHistory. This is useful in
23+ the Git mergetool configuration to always open the history by default.
24+
1825 *DiffConflicts-settings*
1926This plugin doesn't have any settings.
Original file line number Diff line number Diff line change @@ -92,26 +92,23 @@ function! s:checkThenShowHistory()
9292 endif
9393endfunction
9494
95- function ! s: checkThenDiff (showHist )
95+ function ! s: checkThenDiff ()
9696 if (s: hasConflicts ())
97- call s: diffconfl ()
98- if (a: showHist )
99- call s: checkThenShowHistory ()
100- tabfirst
101- endif
102- redraw
103- echohl WarningMsg
104- \ | echon " Resolve conflicts leftward then save. Use :cq to abort."
105- \ | echohl None
97+ redraw
98+ echohl WarningMsg
99+ \ | echon " Resolve conflicts leftward then save. Use :cq to abort."
100+ \ | echohl None
101+ return s: diffconfl ()
106102 else
107103 echohl WarningMsg | echo " No conflict markers found." | echohl None
108104 endif
109105endfunction
110106
111-
112- command ! DiffConflicts call s: checkThenDiff (0 )
113- command ! DiffConflictsWithHistory call s: checkThenDiff (1 )
107+ command ! DiffConflicts call s: checkThenDiff ()
114108command ! DiffConflictsShowHistory call s: checkThenShowHistory ()
109+ command ! DiffConflictsWithHistory call s: checkThenShowHistory ()
110+ \ | 1 tabn
111+ \ | call s: checkThenDiff ()
115112
116113let &cpo = s: save_cpo
117114unlet s: save_cpo
You can’t perform that action at this time.
0 commit comments