I have a way to handle swap files.
And it works but it takes a while.
Here goes:
First I try to find the original vim session -- track down if the PID is still alive -- and if the PID is still alive I go try and find that vim session and save the file and quit... and I'm done (stop here) -- If I can't open the vim session I kill the PID... and have to recover the file.
try to view the diff
- I hit r to recover the file
- save the recovered file to a temporary file
- quit vim
- do a command line vimdiff between the two
- manually fix any conflicts
- save the file
- quit vim
- delete the temporary file
- reopen vim
- done
I wanted to find a way to do the same thing but more efficiently.
How do I view the diff of the file with the recovered file, resolve any differences, save the file without quitting vim or using plugins?
defaults.vim
defines a command for viewing the changes made to a buffer, including the changes made during recovery. Unfortunatelydefaults.vim
is not sourced if a user.vimrc
is present. See:help :recover
and:help :DiffOrig
.