--- templatefile-1.5/vim/plugin/templatefile.vim.orig 2005-05-06 00:06:37 +0400 +++ templatefile-1.5/vim/plugin/templatefile.vim 2005-05-07 19:31:37 +0400 @@ -16,6 +16,10 @@ " If exists enviroment variable $VIMTEMPLATE, templates are loaded from " this directory. +if !exists("g:load_templates") + finish +endif + augroup TemplateSystem autocmd! au BufNewFile * call LoadTemplateFile() @@ -33,16 +37,16 @@ endif let extension = expand ("%:e") if extension == "" - let template_file = "templates/" . expand("%:t") + let template_file = "/templates/" . expand("%:t") let template_func = "TemplateFileFunc_noext_" . expand("%:t") else - let template_file = "templates/skel." . extension + let template_file = "/templates/skel." . extension let template_func = "TemplateFileFunc_" . extension endif if filereadable(expand($VIMTEMPLATE . template_file)) call LoadTemplateFileConfirm($VIMTEMPLATE . template_file) - elseif filereadable(expand($HOME . "/.vim/" . template_file)) - call LoadTemplateFileConfirm($HOME . "/.vim/" . template_file) + elseif filereadable(expand($HOME . "/.vim" . template_file)) + call LoadTemplateFileConfirm($HOME . "/.vim" . template_file) elseif filereadable(expand($VIM . template_file)) call LoadTemplateFileConfirm($VIM . template_file) elseif filereadable(expand($VIMRUNTIME . template_file))