All Projects → ecomfe → sublime-etpl

ecomfe / sublime-etpl

Licence: MIT License
An ETPL syntax definition & snippets specifically for Sublime Text.

Programming Languages

python
139335 projects - #7 most used programming language
Smarty
1635 projects
javascript
184084 projects - #8 most used programming language

Sublime ETPL

An ETPL syntax definition & snippets specifically for Sublime Text.

About ETPL

ETPL is a reusable, flexible, high-performance JavaScript template engine for Browser & Node.

Screenshot

Default syntax & base16-ocean.dark.tmTheme:

Base 16 Ocean

Mustache style syntax & Tomorrow.tmTheme:

Tomorrow

Install

Get it through Git

Clone the repository in your Sublime Text Packages directory:

git clone https://github.com/ecomfe/sublime-etpl.git ETPL

The Packages directory is located at:

  • Sublime Text 3
    • OS X: ~/Library/Application Support/Sublime Text 3/Packages/
    • Linux: ~/.Sublime Text 3/Packages/
    • Windows: %APPDATA%/Sublime Text 3/Packages/
  • Sublime Text 2
    • OS X: ~/Library/Application Support/Sublime Text 2/Packages/
    • Linux: ~/.Sublime Text 2/Packages/
    • Windows: %APPDATA%/Sublime Text 2/Packages/

Get it through Sublime Package Control

If you haven't used it yet, just install it from the link above and then:

  1. Press Shift + Command (or Ctrl) + P
  2. Type install, to bring up the "Package Control: Install Package" option, and press Enter
  3. Look for ETPL, and press Enter to install it.

Settings

Go to Preferences > Package Settings > ETPL > Settings - User, insert & override the following JSON snippet:

{
    "commandOpen": "<!--",
    "commandClose": "-->",
    "variableOpen": "${",
    "variableClose": "}"
}

Usage

Comments

Key bindings for <!-- // ETPL_COMMENTS -->:

  • OS X: Command + /
  • Linux/Windows: Ctrl + /

Snippets

  • target: + Tab<!-- target: TARGET_NAME(master = MASTER_NAME) -->
  • block: + Tab<!-- block: BLOCK_NAME --> ... <!-- /block -->
  • import: + Tab<!-- import: TARGET_NAME -->
  • use: + Tab<!-- use: TARGET_NAME(ASSIGNMENT_EXPRESSIONS) -->
  • var: + Tab<!-- var: VAR_NAME = EXPRESSION -->
  • for: + Tab<!-- for: VARIABLE as ITEM, KEY_OR_INDEX --> ... <!-- /for -->
  • if: + Tab<!-- if: CONDITIONAL_EXPRESSION --> ... <!-- /if -->
  • elif: + Tab<!-- elif: CONDITIONAL_EXPRESSION -->
  • else: + Tab<!-- else -->
  • filter: + Tab<!-- filter: FILTER_NAME(ARGUMENTS) --> ... <!-- /filter -->

Related

Contributors

License

MIT © Baidu Inc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].