A Sublime Text 2/3 plugin for create file from templates.
Github
Go to the "Packages" directory (Preferences / Browse Packages). Then clone this repository:
$ git clone https://github.com/kairyou/SublimeTmpl.git
Package Control
Install [Package Control][1]. Then Package Control: Install Package, look for SublimeTmpl / tmpl and install it.
-
Creat file with menu
File - New File (SublimeTmpl) -
Creat file with command use
cmd+shift+pthen look fortmpl:
Preferences / Packages Settings / SublimeTmpl
ctrl+alt+h html
ctrl+alt+j javascript
ctrl+alt+c css
ctrl+alt+p php
ctrl+alt+r ruby
ctrl+alt+shift+p python
-
custom template files
put your custom template files in
Packages/User/SublimeTmpl/templates -
*.tmplfile support${date}variabledefault "date_format" : "%Y-%m-%d %H:%M:%S" (It is recommended to custom settings in
settings - user) -
custom variables:
attrcustom the attr variables in settings, example:
"attr": { "author": "Your Name" , "email": "you@example.org", "link": "http://example.org" "hello": "word" }
> The `*.tmpl` file will support `${author}` `${email}` `${link}` `${hello}` variables.
Authors
-------
* **Kairyou** ([Blog](http://www.fantxi.com/blog/) / [GitHub](https://github.com/kairyou))
* **Vfasky** ([Blog](http://vfasky.com) / [GitHub](https://github.com/vfasky))
* **Xu Cheng** ([Github](https://github.com/xu-cheng))
FAQ
---
- SublimeTmpl not work after update the package.
Please open `Preferences` / `Settings - User`, remove "SublimeTmpl" from `ignored_packages`.
--------------------
Source: [https://github.com/kairyou/SublimeTmpl][0]
Docs: [中文文档](http://www.fantxi.com/blog/archives/sublime-template-engine-sublimetmpl/)
[0]: https://github.com/kairyou/SublimeTmpl
[1]: http://wbond.net/sublime_packages/package_control