ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

EJS

by SublimeText ALL

EJS syntax for Sublime Text

Details

  • 2018.04.30.22.08.00
    3.0.0
    1.4.7
  • github.​com
  • github.​com
  • 4 weeks ago
  • 4 weeks ago
  • 13 years ago

Installs

  • Total 112K
  • Win 46K
  • Mac 45K
  • Linux 21K
Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9
Windows 1 1 1 1 1 1 1 1 0 3 1 4 0 2 3 1 0 1 1 1 0 1 0 3 1 1 3 2 0 2 2 1 1 0 4 0 6 5 1 6 2 3 2 1 1 0
Mac 0 1 0 0 1 0 2 0 0 0 0 2 0 1 2 0 2 0 0 3 0 1 3 1 0 2 0 1 1 2 0 1 2 0 4 0 1 2 1 0 0 14 0 2 6 0
Linux 0 0 0 0 0 0 0 2 1 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 1 1 0 4 1 0 5 1 0 2 0 2 2 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: <% %>. <? ?>.

preview

Installation

Package Control

The easiest way to install is using Package Control. It's listed as EJS.

  1. Open Command Palette using ctrl+shift+P or menu item Tools → Command Palette...
  2. Choose Package Control: Install Package
  3. Find EJS and hit Enter

Manual Install

  1. Download appropriate EJS.sublime-package for your Sublime Text build.
  2. Copy it into Installed Packages directory

[!NOTE]

To find Installed Packages

  1. call Menu > Preferences > Browse Packages..
  2. 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:

  1. Open an EJS file
  2. Select View from the menu bar
  3. Then select: SyntaxOpen all with current extension as...EJSEJS (<delimiter>)
  4. Repeat for each extension you want to open as EJS

Snippets

In the HTML scope:

  • if+TAB - Inserts EJS if statement
  • for+TAB - Inserts EJS for 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:

  1. call Menu > Preferences > Browse Packages..
  2. Look for HTML, CSS or JavaScript folder
  3. 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.