/vim-diffbuff

A vim plugin to diff the contents of a single buffer.

Primary LanguageVim scriptMIT LicenseMIT

Vim DiffBuff

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.

  1. 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';
  1. Run :DiffBuff

A new tab will open with two scratch buffers set to diff mode.

Here are some fancy screenshots:

Before

After

Yes, this is super specific to my workflow.