Last Updated: February 25, 2016
·
724
· smathy

Re-edit vim files after a crash

To re-edit all files in the current directory hierarchy after returning from a crash (when all the swap files have been left) try this in your bash terminal:

vim -p $(find . -iname '.*.sw[a-p]' | sed -e"s~/\.\([^/]\+\).sw[a-p]$~/\1~")

I add the -p switch so that vim will open them all in their own tab - but you can leave that off if you prefer them in buffers.