SublimeFileTemplates - Installation and Usage
To create a file using a template, I have used Sublime File Templates Package for the Sublime Text. Installation and Usage is explained in the GitHub page of the package.When you install the package, by default, some templates will be installed for some of the file types. If you are not satisfied with the default template, you have an option to customize it.
Here I am going to explain the template customization for the file type *.java
Template Customization for Java
You can locate the templates files for file types at- ~/Library/Application Support/Sublime Text 2/Packages/FileTemplates/Templates (Unix)
- C:/Users/
/AppData/Roaming/Sublime Text 2/Packages/FileTemplates/Templates (windows)
java.file-template
This file looks like
java.java
This is actual template file. When you create the file using this plugin, this file will look like this template file. In this template you can use the arguments defined in java.file-template. Following is an example template file
You might have also observed other parameters as $date2, $author and $year. Where are they coming from? Well these are defined in the file ~/Library/Application Support/Sublime Text 2/Packages/FileTemplates/FileTemplates.sublime-settings. You can again add as much attributes as you need and use in your template file.
FileTemplates.sublime-settings

