Sunday, April 15, 2018

Template File for Sublime Text - Customization

It is always easy to have file templates when we need have them created repeatedly. Today I am going to show file templates in Sublime Text 2.

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)
There you can find template settings file - java.file-template and actual template file - java.java.

java.file-template

This file looks like
Here you can add as much arguments as you need, they will be asked in the order specified and can be used in the template file.

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
The parameter $name in the template file is read from the template settings file java.file-template.

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








5 comments:






  1. Pretty great post. I simply stumbled upon your blog and wanted to mention that I have really loved surfing around your blog posts. Great set of tips from the master himself. Excellent ideas. Thanks for Awesome tips Keep it
    sublime-text-crack
    kaspersky-total-security-crack
    hitman-pro-crack
    avs-video-editor-crack
    total-commande-crack

    ReplyDelete

  2. I thought this was a pretty interesting read when it comes to this topic. Thank you
    backup4all-pro-crack
    sublime-text-crack
    teamviewer-crack

    ReplyDelete
  3. Structure and Content. Use the introduction to get the reader's attention and interest in the topic. Define the problem you are going to discuss and provide a short overview on what you think and why. Summarize the most important arguments that best support your opinion.Outstanding Good for you Phenomenal Good reasoning Praiseworthy Good thinking Prestigious work Good work/Good job Proper Grand Purrrfect Great Remarkable Great going Resounding results Honorable Respectable I appreciate your cooperation. Right on target I appreciate your help.Thank you so much for sharing all this wonderful info with the how-to's!!!! It is so appreciated!!! You always have good humor in your posts/blogs. So much fun and easy to read!
    HitmanPro Crack
    IDM Crack
    Voicemod Pro Crack
    Pixelmator Pro Crack

    ReplyDelete
  4. Download Software for PC & Mac
    You make it look very easy with your presentation, but I think this is important to Be something that I think I would never understand
    It seems very complex and extremely broad to me. I look forward to your next post,
    Mocha Pro Crack
    BeeCut Crack
    Blue-Cloner Crack
    Sublime Text Crack
    Video Copilot Element Crack
    PyCharm Pro Crack
    Resharper Crack
    Agisoft Metashape Pro Crack

    ReplyDelete