I'm comparing two files in vimdiff. For one section of the code in the first file, the same section in the second file has several lines of code added, and then a slightly modified copy of the section from the first file. When displaying the code section in vimdiff, I would like vimdiff to show the added lines in the second file as added (obviously), and then directly compared the slightly modified sections of code side-by-side. However, vimdiff is comparing the section from the first file with the added code in the second file, heavily modified, and then the slightly modified version of the code in the second file as added.

Is there any way to suggest what sections of code to directly compare side-by-side in vimdiff? Something like "shift line 80 of the first file to correspond with line 100 of the second file, and the re-run the diff on the rest of the file"? Or just a way to make that suggestion in the actual diff command and then display the results in vimdiff?

1 Answer 1


How does https://github.com/rickhowe/spotdiff.vim help you? You can select line ranges or area to compare somewhere in files.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .