FileTemplates
File Templates for SublimteText2
Details
Installs
- Total 11K
- Win 6K
- Mac 3K
- Linux 2K
Oct 8 | Oct 7 | Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
This Repository is not actively maintained, Pull-Requests are welcome and will be merged if they make sense.
File Templates for SublimeText 2
This Package enables you and other Package Developers to include File Templates. A File Template is basically a snippet, a filename, a default path and optional arguments.
Demo
http://www.youtube.com/embed/M4isYen7_Z4
Installation
Package Control
The easiest way to install this is with Package Control.
If you just went and installed Package Control, you probably need to restart Sublime Text 2 before doing this next bit.
- Bring up the Command Palette (Command+Shift+p on OS X, Control+Shift+p on Linux/Windows).
- Select “Package Control: Install Package” (it'll take a few seconds)
- Select FileTemplates when the list appears.
Package Control will automatically keep FileTemplates up to date with the latest version.
Clone from GitHub
git clone http://github.com/mneuhaus/SublimeFileTemplates
Usage
Bring up the Command Palette and select “Create File From Template” or set up some key bindings as explained below.
Templates
The Templates are files with the extension “.file-template”
Here's a basic example
<template>
<file>jQueryPlugin.js</file>
<filename>jquery.$name.js</filename>
<path>js/</path>
<arguments>
<name>Name:</name>
</arguments>
</template>
Key bindings
The plugin does not install any key bindings automatically. You can set up your own key bindings like this:
{ "keys": ["super+ctrl+n"], "command": "create_file_from_template" }
If you are using Vintage mode and want to use sequences of non-modifier keys, you can restrict the key bindings to command mode like this:
{ "keys": [" ", "n"], "command": "create_file_from_template", "context": [{"key": "setting.command_mode"}] }
New Features
- add time and date variables,
record file creation time
"creation_time": { "day": "%d", "month": "%m", "year": "%Y", "short_weekdayname": "%a", "weekdayname": "%A", "short_monthname": "%b", "date": "%d/%m/%Y", "time": "%H:%M:%S" }
> use `$day`, `$date`, `$time`, ... in your templates.
- add customizable **attrs** variable,
> add custom variables
>
``` json
"attrs": {
"author": "Your Name",
"company": "Your Company",
"email": "you@example.org",
"github": "github.com/you",
"foo": "bar"
}
use
$author
,$company
,$github
,$foo
in your templates.
Thanks
This Package was forked from SublimeQuickFileCreator because it provided the best base for my needs and a good starting point to learn from :)
Licence
All of SublimeFileTemplates is licensed under the MIT licence.
Copyright © 2012 Anders Nøklestad
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.