EJS syntax definition for Sublime Text 3 & 4. Includes EJS tag autocompletion and snippets.
Use Package Control to install EJS 2.
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 2
→EJS (<delimiter>)
- Repeat for each extension you want to open as EJS
This package includes syntax definitions for the following additional delimiters: <? ?>
, <$ $>
, <@ @>
.
EJS 2
comes with the Dracula EJS
color scheme, which is a modified/updated version of zertosh’s old dracula theme. You can select it from: Preferences
→ Color Scheme
.
Oceanic Next
is also a good color scheme for EJS that works right out of the box.
If you'd prefer to use a different color scheme, you may need to add lines like these to make the highlighting more compatible with EJS.
In the HTML scope:
if
+TAB
- Inserts EJSif
statementfor
+TAB
- Inserts EJSfor
loop
Most problems are best addressed by opening an issue.