문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top