DEV Community

Jesse Phillips
Jesse Phillips

Posted on

3 3

Scratch Diff Using Vim

First as I have not seen this term utilized let me define what I mean by a "scratch diff." I have chosen this in reference to a "scratch pad." The idea is that you have some text and would like clarity in what is different between them, but you don't need to make a big deal out of the comparison.

Previously I have done this with creating two files and placing the text desired in both of them. Getting the filesystem involved at times just seems like too much for the desired diff. But an internet diff is also not acceptable because at times I need to manipulate the formatting/structure to get a decent comparison.

Well I finally took some time to learn the vim approach to making a scratch diff and isn't too bad.

After opening Vim

:vnew
:diffthis
<ctrl+w><ctrl+w>
:diffthis
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay