I use the solution provided here, reproduced below:
function! s:DiffWithSaved() let filetype=&ft diffthis vnew | r # | normal! 1Gdd diffthis exe "setlocal bt=nofile bh=wipe nobl noswf ro ft=" . filetype endfunction com! DiffSaved call s:DiffWithSaved()
to individually check the diff of the buffer that currently has the cursor/focus with its earlier saved version on disk. To check the diff of a different buffer, I navigate to that buffer after giving a
:q to exit the current diff and repeat
:DiffSaved on that new buffer.
Can this process be automated so that a single command can be issued that automatically only does a
DiffSaved for buffers that have diverged from the saved version on disk during a long editing session? Is there any easy way to navigate the various diffs that would be displayed (Quickfix list, or something similar)?