From ac2fcf669aeb6e6d1013976294674977d2100fc4 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 4 Sep 2013 20:46:16 -0400 Subject: script to clean out my undo directory --- bin/clean-vim-undo | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 bin/clean-vim-undo (limited to 'bin/clean-vim-undo') diff --git a/bin/clean-vim-undo b/bin/clean-vim-undo new file mode 100755 index 0000000..0c234eb --- /dev/null +++ b/bin/clean-vim-undo @@ -0,0 +1,13 @@ +#!/usr/bin/env perl +use strict; +use warnings; + +my $undodir = "$ENV{HOME}/.vim/undo"; +opendir my $undo, $undodir + or die "can't open $undodir: $!"; + +for my $undofile (readdir($undo)) { + next unless -f "$undodir/$undofile"; + (my $file = $undofile) =~ s{%}{/}g; + unlink "$undodir/$undofile" unless -e $file && $file =~ m{^/}; +} -- cgit v1.2.3-54-g00ecf