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!
Categories