.vim/autoload/vimrc.vim

changeset 920
c1cc35d18597
parent 897
760d4f0ca87b
child 939
b769704bb258
equal deleted inserted replaced
919:79348384a55e 920:c1cc35d18597
85 endif 85 endif
86 finally 86 finally
87 call delete(errors) 87 call delete(errors)
88 endtry 88 endtry
89 endfunc 89 endfunc
90
91 if has('perl')
92 func! vimrc#PruneSession() abort
93 perl <<END_PERL
94 my @bufs =
95 grep { !-e $_->Name || -d _ || (-M _ >= 30) }
96 grep { $_->Name } VIM::Buffers();
97
98 while (my $b = shift @bufs) {
99 VIM::Msg 'pruned: ' . $b->Name, 'Comment';
100 VIM::DoCommand 'bwipeout ' . $b->Number;
101 }
102 VIM::DoCommand 'bprev'
103 unless $curbuf->Name;
104 END_PERL
105 endfunc
106 endif

mercurial