Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to make Visual Studio Code recognize HTML syntax in EJS files

I am using Visual Studio Code on a Mac to work on Node.js applications.

Is there a way to make Visual Studio Code recognize EJS files as HTML markup? I didn't see any file / scheme association in user preferences.

like image 236
mikebz Avatar asked May 15 '15 16:05

mikebz


People also ask

Does VSCode support EJS?

By default VSCode does not have syntax highlighting for EJS template files. You need to install a plugin like this one - EJS language support. You also need to configure the file association for .

How do I get the HTML syntax in Visual Studio code?

Go to the Extensions view (Ctrl+Shift+X) and type 'html' to see a list of relevant extensions to help with creating and editing HTML.


1 Answers

Actually, you can.

As Andre points out, now you can do this in the workspace settings.Go to Visual Studio Code Settings: File >> Preferences >> User Settings

// Place your settings in this file to overwrite the default settings  {                  // Configure file associations to languages (e.g. "*.extension": "html"). These have precedence over the default associations of the languages installed.       "files.associations": {"*.ejs": "html"}        }

Click on the 'Plain text' tab at the bottom of the VS Code window and change it to HTML, screenshot below:

enter image description here

like image 80
viztastic Avatar answered Sep 20 '22 00:09

viztastic