vimdiff usage code example
Example 1: vim compare 2 files
#open second file in vim with ":vsp mysecondfile.txt" then
:windo diffthis
Example 2: vim diff with saved
:w !diff % -
#open second file in vim with ":vsp mysecondfile.txt" then
:windo diffthis
:w !diff % -