I was just editing a file in vi on my iPad using diet coda. Hadn’t saved it and the app crashed. Boo.
Tried to open the .swp file, oops, don’t do that.
[code]vi -r file[/code]
Open the file as if it existed, but using the -r flag (recover, suprisingly) vi will look for the .swp file and make it all better.
Then just save it as usual.