| version 1.7, 2003/01/10 11:52:11 |
version 1.8, 2003/01/12 18:25:20 |
|
|
| " Vim global plugin for autoload template files |
" Vim global plugin for autoload template files |
| " File: templatefile.vim |
" File: templatefile.vim |
| " Maintainer: Lubomir Host <8host AT pauli.fmph.uniba.sk> |
" Maintainer: Lubomir Host <8host AT pauli.fmph.uniba.sk> |
| " Last Change: 2003/01/10 |
" Last Change: 2003/01/12 |
| " Version: $Platon:$ |
" Version: $Platon: vimconfig/vim/plugin/templatefile.vim,v 1.7 2003/01/10 11:52:11 rajo Exp $ |
| " Thanks: |
" Thanks: |
| " Scott Urban: First version of templatefile.vim |
" Scott Urban: First version of templatefile.vim |
| " http://vim.sourceforge.net/scripts/script.php?script_id=198 |
" http://vim.sourceforge.net/scripts/script.php?script_id=198 |
| Line 52 fun! LoadTemplateFile() |
|
| Line 52 fun! LoadTemplateFile() |
|
| " Template not found |
" Template not found |
| endif |
endif |
| |
|
| let date = strftime("%c") |
let date = strftime("%d/%m/%Y") |
| let year = strftime("%Y") |
let year = strftime("%Y") |
| let cwd = getcwd() |
let cwd = getcwd() |
| let lastdir = substitute(cwd, ".*/", "", "g") |
let lastdir = substitute(cwd, ".*/", "", "g") |
| Line 67 fun! LoadTemplateFile() |
|
| Line 67 fun! LoadTemplateFile() |
|
| if exists("g:email") |
if exists("g:email") |
| let Email = g:email |
let Email = g:email |
| endif |
endif |
| |
if exists("g:company") |
| |
let Company = g:company |
| |
endif |
| silent! execute "%s/@DATE@/" . date . "/g" |
silent! execute "%s/@DATE@/" . date . "/g" |
| silent! execute "%s/@YEAR@/" . year . "/g" |
silent! execute "%s/@YEAR@/" . year . "/g" |
| silent! execute "%s/@LASTDIR@/" . lastdir . "/g" |
silent! execute "%s/@LASTDIR@/" . lastdir . "/g" |
| Line 76 fun! LoadTemplateFile() |
|
| Line 79 fun! LoadTemplateFile() |
|
| silent! execute "%s/@INCLUDE_GAURD@/" . inc_gaurd . "/g" |
silent! execute "%s/@INCLUDE_GAURD@/" . inc_gaurd . "/g" |
| silent! execute "%s/@AUTHOR@/" . Author . "/g" |
silent! execute "%s/@AUTHOR@/" . Author . "/g" |
| silent! execute "%s/@EMAIL@/" . Email . "/g" |
silent! execute "%s/@EMAIL@/" . Email . "/g" |
| |
silent! execute "%s/@COMPANY@/" . Company . "/g" |
| if exists ("*" . template_func) |
if exists ("*" . template_func) |
| if exists("g:load_templates") |
if exists("g:load_templates") |
| if g:load_templates == "ask" |
if g:load_templates == "ask" |