aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Bobov <abobov@gmail.com>2013-10-11 09:41:55 +0600
committerAnton Bobov <abobov@gmail.com>2013-10-11 09:43:58 +0600
commitbf976b49c9fa7604bd208cb3d8dc4d0e4c274641 (patch)
treec03510d304a751734cd746f8eaa67c21e557b946
parentaa6bc2dc0c8ef8da386906ed1fa92eea5b009833 (diff)
Add vim template plugin.
-rw-r--r--.gitmodules5
m---------files/.vim/bundle/vim-template0
-rwxr-xr-xfiles/.vim/templates/template.html10
-rwxr-xr-xfiles/.vim/templates/template.py8
-rwxr-xr-xfiles/.vim/templates/template.sh1
-rwxr-xr-xfiles/.vim/templates/template.xml4
-rwxr-xr-xfiles/.vim/templates/template.xsl13
-rw-r--r--files/.vimrc1
8 files changed, 41 insertions, 1 deletions
diff --git a/.gitmodules b/.gitmodules
index 4caa8d3..9501c0b 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -20,12 +20,15 @@
[submodule "nerdtree"]
path = files/.vim/bundle/nerdtree
url = https://github.com/scrooloose/nerdtree
+[submodule "vim-template"]
+ path = files/.vim/bundle/vim-template
+ url = https://github.com/aperezdc/vim-template
[submodule "vim-markdown"]
path = files/.vim/bundle/vim-markdown
url = https://github.com/plasticboy/vim-markdown.git
[submodule "vim-jade"]
path = files/.vim/bundle/vim-jade
- url = git://github.com/digitaltoad/vim-jade.git
+ url = https://github.com/digitaltoad/vim-jade.git
[submodule "xml.vim"]
path = files/.vim/bundle/xml.vim
url = https://github.com/othree/xml.vim
diff --git a/files/.vim/bundle/vim-template b/files/.vim/bundle/vim-template
new file mode 160000
+Subproject 88f7a46a746d8ae28ad1241b3b107e2a44f3467
diff --git a/files/.vim/templates/template.html b/files/.vim/templates/template.html
new file mode 100755
index 0000000..84a4f1c
--- /dev/null
+++ b/files/.vim/templates/template.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+ <title>%FILE%</title>
+</head>
+<body>
+ %HERE%
+</body>
+</html>
diff --git a/files/.vim/templates/template.py b/files/.vim/templates/template.py
new file mode 100755
index 0000000..f6f948d
--- /dev/null
+++ b/files/.vim/templates/template.py
@@ -0,0 +1,8 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+def main():
+ %HERE%
+
+if __name__ == '__main__':
+ main()
diff --git a/files/.vim/templates/template.sh b/files/.vim/templates/template.sh
new file mode 100755
index 0000000..0774808
--- /dev/null
+++ b/files/.vim/templates/template.sh
@@ -0,0 +1 @@
+#!/bin/sh
diff --git a/files/.vim/templates/template.xml b/files/.vim/templates/template.xml
new file mode 100755
index 0000000..af292fc
--- /dev/null
+++ b/files/.vim/templates/template.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<%FILE%>
+ %HERE%
+</%FILE%>
diff --git a/files/.vim/templates/template.xsl b/files/.vim/templates/template.xsl
new file mode 100755
index 0000000..c0e54b8
--- /dev/null
+++ b/files/.vim/templates/template.xsl
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:output method="xml" indent="yes"/>
+ <xsl:strip-space elements="*"/>
+
+ <xsl:template match="node()|@*">
+ <xsl:copy>
+ <xsl:apply-templates select="node()|@*"/>
+ </xsl:copy>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/files/.vimrc b/files/.vimrc
index d3927fa..1044a3a 100644
--- a/files/.vimrc
+++ b/files/.vimrc
@@ -9,6 +9,7 @@ if has("multi_byte")
endif
let g:CSApprox_verbose_level=0
+let g:template_dir=$HOME . "/.vim/templates"
set encoding=utf-8