vim compare 2 files code example Example: vim compare 2 files #open second file in vim with ":vsp mysecondfile.txt" then :windo diffthis