How to compare vim’s in-memory buffers

I often find myself just want to compare the contents of buffers in memory as I may use something like “:sort” or a find and replace and not necessarily want to save that modified buffer to disk. Well vim provides a very handy way to do this…

First, if you opened a comparison using gvimdiff or you already ran a diff, then you will want to reset your diff using:

:windo diffoff

From here you can perform the diff using the new contents of the buffers with:

:windo diffthis

That is that!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s