This is an enhanced version of the snippet provided under :help diff-original-file.
Where the original :DiffOrig only shows differences between the buffer in memory and the file on disk, :Diff can be used in two ways:
-
against the file on disk, like the original, with:
:Diff -
against an arbitrary Git revision of the current file, with:
:Diff HEAD
I have modified
:Diffto take<mods>, set'filetype, and do:diffoff!when the scratch buffer is wiped.