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.
77
77
git config --global mergetool.keepBackup false
78
78
```
79
79
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
+
80
87
3. During a merge you can call `:DiffConflictsShowHistory` to open a new tab
81
88
containing the merge BASE and full copies of the LOCAL and REMOTE versions
82
89
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
11
11
git config --global mergetool.keepBackup false
12
12
13
13
Commands:
14
+ :DiffConflicts
15
+ Convert a file containing Git conflict markers into a two-way diff.
16
+
14
17
:DiffConflictsShowHistory
15
18
Open a new tab containing the merge base and the local and remote
16
19
version of the conflicted file.
17
20
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
+
18
25
*DiffConflicts-settings*
19
26
This plugin doesn't have any settings.
Original file line number Diff line number Diff line change @@ -92,26 +92,23 @@ function! s:checkThenShowHistory()
92
92
endif
93
93
endfunction
94
94
95
- function ! s: checkThenDiff (showHist )
95
+ function ! s: checkThenDiff ()
96
96
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 ()
106
102
else
107
103
echohl WarningMsg | echo " No conflict markers found." | echohl None
108
104
endif
109
105
endfunction
110
106
111
-
112
- command ! DiffConflicts call s: checkThenDiff (0 )
113
- command ! DiffConflictsWithHistory call s: checkThenDiff (1 )
107
+ command ! DiffConflicts call s: checkThenDiff ()
114
108
command ! DiffConflictsShowHistory call s: checkThenShowHistory ()
109
+ command ! DiffConflictsWithHistory call s: checkThenShowHistory ()
110
+ \ | 1 tabn
111
+ \ | call s: checkThenDiff ()
115
112
116
113
let &cpo = s: save_cpo
117
114
unlet s: save_cpo
You can’t perform that action at this time.
0 commit comments