sponsor Vim development Vim logo Vim Book Ad

cleanswap : capture useful text from, and delete, all the vim swap files in ~/.vim/swap

 script karma  Rating 9/3, Downloaded by 802  Comments, bugs, improvements  Vim wiki

created by
Chris Houser
 
script type
utility
 
description
This is a super-simple bash script for cleaning up my ~/.vim/swap directory.  I have vim put all its swap files there (set directory=~/.vim/swap) so I can find them in one place.

When I run this script, it recovers using each swap file and compares the results against the current version of the file.  If there is no difference, the swap file is automatically deleted. If there are differences, vimdiff is launched so I can recover any changes saved only in the swap file.  When the script is don running, all my swap files are gone.

Warning: This script has only been tested on Linux, and that only a couple times. It may accidentally delete any file on your system.  If you have any other vim sessions running, I assume bad things will happen if you also run this script.  Use at your own risk!
 
install details
Copy this to some directory in your PATH.  Run it.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
cleanswap 0.1 2006-10-10 7.0 Chris Houser Improvements in stability, bug fixes... you know, that sort of thing.
cleanswap 0.0 2005-01-22 6.0 Chris Houser Initial upload
ip used for rating: 3.144.212.145

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github