Saturday, March 11, 2017

How to delete hidden .swap files (.sw?) if there are no changes?

I have near a dozen files where I have both a ".cc and a .h"
open but had a desktop reboot, so all have swap files now.
Just now, I opened them all and found that only 1
pair had any changes that needed to be addressed, but the
others were all 'unmodified'.


Is there a way to have vim automatically delete the swap
files for which there are no changes and no running process?

Alternative, is there a way to tell in a shell that
some correspond to unmodified files so I could pre-delete
them in restarting gvim for all the files?

I don't want to blindly try to recover them, as any that
do have actual changes, I want to know about so I
can write them to /tmp and compare them w/the origs to
see if what the changes are and if they should be kept
(usually should, but occasionally not).

Thanks in advance!
-linda





--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment