.vim/autoload/vimrc.vim

changeset 939
b769704bb258
parent 920
c1cc35d18597
child 940
fb5519032710
equal deleted inserted replaced
938:26a36c7d29bb 939:b769704bb258
102 VIM::DoCommand 'bprev' 102 VIM::DoCommand 'bprev'
103 unless $curbuf->Name; 103 unless $curbuf->Name;
104 END_PERL 104 END_PERL
105 endfunc 105 endfunc
106 endif 106 endif
107
108 func! vimrc#PrepDir(path, prune_days) abort
109 if !filewritable(path)
110 call mkdir(path, 'p', 0700)
111 endif
112 endfunc
113
114 func! vimrc#PruneFiles(path, days) abort
115 let l:path = expand(a:path)
116 if isdirectory(l:path)
117 for file in split(globpath(l:path, "*"), "\n")
118 if localtime() > getftime(file) + 86400 * a:days
119 delete(file) != 0
120 endif
121 endfor
122 else
123 endfunc

mercurial