An ETPL syntax definition & snippets specifically for Sublime Text.
ETPL is a reusable, flexible, high-performance JavaScript template engine for Browser & Node.
Default syntax & base16-ocean.dark.tmTheme:
Mustache style syntax & Tomorrow.tmTheme:
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/
- OS X:
- Sublime Text 2
- OS X:
~/Library/Application Support/Sublime Text 2/Packages/ - Linux:
~/.Sublime Text 2/Packages/ - Windows:
%APPDATA%/Sublime Text 2/Packages/
- OS X:
If you haven't used it yet, just install it from the link above and then:
- Press Shift + Command (or Ctrl) + P
- Type
install, to bring up the "Package Control: Install Package" option, and press Enter - Look for
ETPL, and press Enter to install it.
Go to Preferences > Package Settings > ETPL > Settings - User, insert & override the following JSON snippet:
{
"commandOpen": "<!--",
"commandClose": "-->",
"variableOpen": "${",
"variableClose": "}"
}Key bindings for <!-- // ETPL_COMMENTS -->:
- OS X: Command + /
- Linux/Windows: Ctrl + /
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 -->
MIT © Baidu Inc.

