4 Answers
4

Vim swap files are normally hidden (Unix hidden files begin with a .). In order to view hidden files as well as regular ones, you need to ls -A (mnemonic: A for All). That should show you whether a swap file is there or not.

If there were unsaved changes, you can recover them using vi -r (or vim -r if you prefer). I usually write the recovered file to a temporary file and diff it against the main file. (I don't quite trust the recovery not to lose information.)
–
Keith ThompsonFeb 29 '12 at 3:26