3

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.

phatmanace
  • 4,671
  • 3
  • 24
  • 29

1 Answers1

0

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.

Ben
  • 8,725
  • 1
  • 30
  • 48
  • This looks like pretty much what i need, and thanks for confirmation that vanilla vimdiff doesn't do what i nees – phatmanace Aug 28 '13 at 21:59
  • 1
    @phatmanace Did you end up figuring how to use both hunks using splice? I can't be able to do it. – Michael May 30 '16 at 01:58
  • @Michael, I wasted hours trying to make splice work and gave up... AFAICT, the author could not care less about responding to t installation / usage [github issues](https://github.com/sjl/splice.vim/issues) – Mike Pennington Oct 27 '20 at 08:13