while giving the dp
command in vimdiff it replaces the entire block(2 lines) with pink colour on left hand side file to right hand side file.
In that block if i want to merge only the second line. First line should not be Merged.
while giving the dp
command in vimdiff it replaces the entire block(2 lines) with pink colour on left hand side file to right hand side file.
In that block if i want to merge only the second line. First line should not be Merged.
Go to the one line that you need to be overwritten:
:.diffget
Or just:
:.diffg
If you want to re-calculate the "pink areas" now:
:diffu
If the line is absent, it's best to hit O
to add an empty line and then do a :.diffg
Just adding it as an answer, so people can vote on it. For me it works better (when bound to a key combo) than do
or dp
.
You can just copy the part of the code you want to copy over using:
V
key and then select just the text you want to move; and then hit yy
to yank it.CTRL+ww
to switch windows, and then move your cursor to the desired location p
to paste it in the desired location.