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.
Written by Jason King
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#