does vimdiff support merging diffs

198 views Asked by At

Can vimdiff support a merge of diffs that are on the same line (so that I get the aggregate of them?)

example: starting with the following conflict markers:

I
like
apples
peaches
<<<<<<< HEAD
bananas
=======
cherries
>>>>>>> diverge
for supper

in the example above, can I use the do and dp commands to actually merge the diffs, or can I only end up with one of the other? put another way, If I'd like to end up with

I
like
apples
peaches
bananas
cherries
for supper

then can I do this with diffpush and get, or do I have to drop back to basic vim commands to select the hunks to merge? as bananas and cherries are on the same line, diffget and push can control which I pick, but I dont seem to be able to have both and merge.

1

There are 1 answers

3
Ben On BEST ANSWER

Not without a plugin/mapping. By default, you will need to resort to normal editing commands.

It looks like the "Splice" plugin ( https://github.com/sjl/splice.vim ) provides mappings to select hunks from multiple files; I haven't used it though so it may not work the way I assume.