c0d3 :: j0rg3

A collection of tips, tricks and snips. A proud Blosxom weblog. All code. No cruft.

Wed, 08 May 2013

Deleting backup files left behind by Vim

It’s generally a great idea to have Vim keep backups. Once in awhile, they can really save your bacon.

The other side of that coin, though, is that they can get left behind here and there, eventually causing aggravation.

Here’s a snippet to find and eliminate those files from the current directory down:

find ./ -name '*~' -exec rm '{}' \; -print -or -name ".*~" -exec rm {} \; -print
This uses find from the current directory down (./) to execute an rm statement on all files with an extension ending in tilde (~)
Alternatively, you could just store your backups elsewhere. In Vim, use :help backupdir for more information.


Tags: , , , ,
Permalink: 20130508.delete.vim.backups