Git Product home page Git Product logo

sublime-template's Introduction

============================= Simple Sublime templates plugin

:Author: Kurten Chan [email protected]

This is a simple plugin for sublime text 2 that will allow you to have a set of templates for certain file types. It is useful to add boilerplate code like guards in C/C++ headers, or license disclaimers.

Installation

Can't change sublime-template to other name.

  1. cd Sublime Text 2/Packages/

  2. git clone git://github.com/kurten/sublime-template.git

Updating

  1. cd Sublime Text 2/Packages/sublime-template

  2. git pull

Setting

In your Preferences.sublime-settings you can put:

  • sublime_template_template : "template" to define your own template(in Sublime Text 2/Packages/sublime-template/templates/ folder).

  • sublime_template_user : "Kurten Chan" to define who create file.

  • sublime_template_email : "[email protected]" to define creator's email.

  • sublime_template_guard : "guard" to define a string with alphanumeric characters and underscores.

Usage

use Command Palette and select Sublime Template: New File With Template

Variables in templates

The following variables will be expanded in templates:

%DAY%, %YEAR%, %MONTH%
Numerical day of the month, year and month.
%DATE%
Date in YYYY-mm-dd format
%TIME%
Time in HH:MM format
%FDATE
Full date (date + time), in YYYY-mm-dd HH:MM format.
%FILE%
File name, without extension.
%FFILE%
File name, with extension.
%MAIL%
Current user's e-mail address. May be overriden by defining sublime_template_email.
%USER% Current logged-in user name. May be overriden by defining sublime_template_user.
%HOST%
Host name.
%GUARD%
A string with alphanumeric characters and underscores, suitable for use in proprocessor guards for C/C++/Objective-C header files.
%HERE%
Expands to nothing, but ensures that the cursor will be placed in its position after expanding the template.

Thanks to aperezdc,I use his vim-template projects template files.

sublime-template's People

Contributors

kurten avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.