Skip to content

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!

TheSoftwareProgrammer View All

I like science and writing software.

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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: