Earlier quoted context omitted.
> I don't think the problem is actually swap files themselves, though, but the user experience with them. Agreed, the UX is 99% the reason of me hating swap files. More often than not I choose recover, only to discover the diff is literally null. Come on, you could not check for that before interrupting? And then in any case you have double the annoyance with that recovered buffer as the old swap remains and you have…
> only to discover the diff is literally null. Note that you can save the trouble of running diff by watching for the message "Buffer contents equals file contents." Only when they're different, you'll want to write the file to another place and diff it. What bugs me a lot is that, even if the contents are equal, it doesn't cleanup the swap file... is there maybe a command for that so I don't have to go back to my te…
nmap d :w !diff -u % -
It writes the buffer’s content to diff’s stdin, and diff gets passed the filename (hence the current on disk content) to compare vs stdin (hence the current buffer content).Only I wish it were run automatically by vim in aforementioned cases before whining (case a: recover, run the above, if no diff stop complaining; case b: rewind til last save, run the above, if no diff then replay and save without complaining)
[0]: https://github.com/lloeki/vimfiles/blob/9c50f3be60e536518beb...