How does SublimeText2 highlight the syntax of the ejs template?

Source: Internet
Author: User
Rt, the file suffixed with ejs has seen falsefalsesublime-ejs road GitHub, but it can only highlight between & lt ;%%& gt; in html, in addition, I do not know which rt should be put after decompression, and the file suffixed with ejs
Falsefalse/sublime-ejs GitHub But he can only highlight the content between <%> in html, and I don't know where to put the content after decompression: I use sublime 3. I don't know if 2 has this function. I use sublime 3. I don't know if 2 has this function.

After setting as follows
~ Generate HTML. sublime-settings in the/. config/sublime-text-3/Packages/User directory. The content is as follows:
At present, there is a suitable plug-in Sublime Text 3.
  • Install Babel
  • Install EJS2
(EJS2 depends on the Babel plug-in. You need to install these two plug-ins at the same time)
Setting Process: View-> Syntax-> EJS2-> <%> or ( , <$ >,< @> ).
Shown as follows:
I am the principal.
Finally, I gave up the idea of making the file with the suffix ejs highlighted. Instead, I used html as the suffix.
In this way, the html rules can be highlighted in Sublime.
Declare the suffix html, not the code of ejs:

EJS.config({ext:'.html'})
Add a line in % APPDATA %/Packages/HTMLpackages/HTML. tmLanguage Ejs And restart Sublime Text 2 (as to where to add it, you will know it immediately after opening the file ), similarly, if we want Sublime Text 2 to apply a default syntax to files with any extension, we only need to find the package corresponding to the syntax and add the extension to the configuration.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.