17 endif |
17 endif |
18 finally |
18 finally |
19 call delete(errors) |
19 call delete(errors) |
20 endtry |
20 endtry |
21 endfunc |
21 endfunc |
22 |
|
23 if has('perl') |
|
24 func! vimrc#PruneSession() abort |
|
25 perl <<END_PERL |
|
26 my @bufs = |
|
27 grep { !-e $_->Name || -d _ || (-M _ >= 30) } |
|
28 grep { $_->Name } VIM::Buffers(); |
|
29 |
|
30 while (my $b = shift @bufs) { |
|
31 VIM::Msg 'pruned: ' . $b->Name, 'Comment'; |
|
32 VIM::DoCommand 'bwipeout ' . $b->Number; |
|
33 } |
|
34 VIM::DoCommand 'bprev' |
|
35 unless $curbuf->Name; |
|
36 END_PERL |
|
37 endfunc |
|
38 endif |
|
39 |
22 |
40 if has('ruby') |
23 if has('ruby') |
41 func! s:PruneFiles(path, days) abort |
24 func! s:PruneFiles(path, days) abort |
42 ruby <<END_RUBY |
25 ruby <<END_RUBY |
43 require 'pathname' |
26 require 'pathname' |