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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay