Skip to content

Commit e0f43ef

Browse files
committed
templates
1 parent 8843939 commit e0f43ef

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

profiles/tmpl.vim

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
" templates for new files
2+
3+
command! -complete=file -nargs=1 Template call Template("<args>")
4+
5+
function! Template(args)
6+
execute "edit ".a:args
7+
let filename = expand("%:p:t")
8+
for path in pathogen#split(&runtimepath)
9+
let tmpl = path."/templates/".filename
10+
if filereadable(tmpl)
11+
execute "read ".tmpl
12+
execute "1:del"
13+
break
14+
endif
15+
let splitted = split(filename, "\.")
16+
if len(splitted)
17+
let tmpl = path."/templates/tmpl.".splitted[-1]
18+
if filereadable(tmpl)
19+
execute "read ".tmpl
20+
execute "1:del"
21+
break
22+
endif
23+
endif
24+
endfor
25+
endfunction

templates/buildout.cfg

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[buildout]
2+
newest = false
3+
prefer-final = true
4+
parts = eggs
5+
6+
[eggs]
7+
recipe = z3c.recipe.scripts
8+
eggs =
9+

templates/tmpl.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# -*- coding: utf-8 -*-
2+

0 commit comments

Comments
 (0)