X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.vim%2Fplugin%2Ftmpwatch.vim;h=0db1dddeeb9351796c47417b5e847516fac83652;hb=bb53f00ff30828e780af5833fb5ef96e1ce0aebd;hp=98a7062c60e3d4494693cb88add4c03059eef10d;hpb=2677c7ba5c07f723b6906bef6da70e7016d1d6f2;p=dotfiles.git diff --git a/.vim/plugin/tmpwatch.vim b/.vim/plugin/tmpwatch.vim index 98a7062..0db1ddd 100644 --- a/.vim/plugin/tmpwatch.vim +++ b/.vim/plugin/tmpwatch.vim @@ -5,16 +5,16 @@ function Tmpwatch(path, days) if isdirectory(l:path) for file in split(globpath(l:path, "*"), "\n") if localtime() > getftime(file) + 86400 * a:days && delete(file) != 0 - echo "Tmpwatch(): Error deleting '" . file . "'" + echoerr "Tmpwatch(): Error deleting '" . file . "'" endif endfor else - echo "Tmpwatch(): Directory '" . l:path . "' not found" + echoerr "Tmpwatch(): Directory '" . l:path . "' not found" endif endfunction " undofile part of your .vimrc -if exists("+undofile") +if exists("+undofile") && !empty(&undodir) && (&undodir != '.') " remove undo files which have not been modified for 31 days call Tmpwatch(&undodir, 31) endif