Vim is great at diffing things, but they have to be in ahem different buffers. This plugin helps you to diff two halves of the same buffer.
- Place your cursor on the line that starts the second half of the buffer.
SELECT *
FROM people
WHERE first_name = 'Malcolm';
SELECT * <put your cursor on this line>
FROM people
WHERE first_name = 'Zoe';
- Run
:DiffBuff
A new tab will open with two scratch buffers set to diff mode.
Here are some fancy screenshots:
Yes, this is super specific to my workflow.