While it has already been answered how to start the diff, it's also important how to stop it in all windows. For completeness, I repeat the comment from @Bernhard.
Start and Stop Diff of two files opened in 2 Windows (works in both, vertical and horizontal split):
:windo diffthis
:windo diffoff
this can be shortened to either
:windo difft
:windo diffo
or
:windo difft
:diffo!
Be aware that opened windows for showing plugin content lead to issues. So close stuff like NERDtree, minibufexplorer++ etc before.
Custom commands:
To ease up things you can add custom commands to your ~/.vimrc
:
command! Difft [ClosePluginWindow |] windo diffthis
command! Diffo windo diffoff
with [ClosePluginWindow |]
being optional to close plugin windows you usually use. For NERDtree e.g. this would be NERDTreeClose |
.
Credits go to @cxw and @Jordi Freixa.