I use Vim. I open a file. I edit it and I want to see what I\'ve edited before I save it.
How can I do this in Vim?
You can make vim create a last backup and original backup with:
:set backup
:set patchmode=.orig
Thereafter, you can open them in a split:
:vsp %:p~ or :vsp %:.orig
And from there do:
:vimdiff in each buffer
If you're dead set on no leftovers but want vimdiff, you could also do:
ggVGy # copy the whole buffer
:vnew # open a split
CTRL-W w # switch to it
shift-P # paste at start
and then do :diffthis on each split