EJS
EJS syntax for Sublime Text
Details
Installs
- Total 112K
- Win 46K
- Mac 45K
- Linux 21K
Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | Aug 13 | Aug 12 | Aug 11 | Aug 10 | Aug 9 | Aug 8 | Aug 7 | Aug 6 | Aug 5 | Aug 4 | Aug 3 | Aug 2 | Aug 1 | Jul 31 | Jul 30 | Jul 29 | Jul 28 | Jul 27 | Jul 26 | Jul 25 | Jul 24 | Jul 23 | Jul 22 | Jul 21 | Jul 20 | Jul 19 | Jul 18 | Jul 17 | Jul 16 | Jul 15 | Jul 14 | Jul 13 | Jul 12 | Jul 11 | Jul 10 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 2 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 1 | 2 | 0 | 3 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 0 | 1 | 2 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
Mac | 0 | 1 | 0 | 2 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 2 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 1 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 |
Linux | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 1 | 0 | 0 | 1 | 1 | 1 |
Readme
- Source
- raw.githubusercontent.com
EJS
EJS syntax definition for Sublime Text based on its HTML, CSS and JavaScript syntax definitions.
Supported template tag variants are: <% %>
. <? ?>
.
Installation
Package Control
The easiest way to install is using Package Control. It's listed as EJS
.
- Open
Command Palette
using ctrl+shift+P or menu itemTools → Command Palette...
- Choose
Package Control: Install Package
- Find
EJS
and hit Enter
Manual Install
- Download appropriate EJS.sublime-package for your Sublime Text build.
- Copy it into Installed Packages directory
[!NOTE]
To find Installed Packages…
- call Menu > Preferences > Browse Packages..
- Navigate to parent folder
Setting the default syntax
By default, files with the extension .ejs
are opened with the EJS (<% %>)
syntax.
To open files with a different extension as EJS, or to use delimiters other than <% %>
, follow these steps to set the default EJS syntax for a file extension:
- Open an EJS file
- Select
View
from the menu bar - Then select:
Syntax
→Open all with current extension as...
→EJS
→EJS (<delimiter>)
- Repeat for each extension you want to open as EJS
Snippets
In the HTML scope:
if
+TAB
- Inserts EJSif
statementfor
+TAB
- Inserts EJSfor
loop
Troubleshooting
§1 Syntax Definition Parse Errors
EJS extends Sublime Text's HTML, CSS and JavaScript syntax definition.
If EJS syntax highlighting doesn't work and console displays syntax errors in EJS.sublime-syntax, please make sure to remove any out-dated syntax override.
Steps:
- call Menu > Preferences > Browse Packages..
- Look for HTML, CSS or JavaScript folder
- Remove them or at least delete any syntax definition in it.
§2 Scripts are not correctly highlighted
EJS relies on JavaScript (source.js
)
to scope script blocks and inline scripts.
Make sure to remove related out-dated syntax packages, which don't meet least compatibility requirements.
They can be identified by calling
e.g. sublime.find_syntax_by_scope("source.js")
in ST's console.
Known candidates are:
Contributing
Most problems are best addressed by opening an issue.