Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 3 Package for EJS formatting

I'm looking for a package to format my ejs files. I already found "html-css-js prettify" and set "ejs" as an allowed_file_extensions but this didn't work. When I use de default configuration in the other options all expression language broke. When I set "%" in the array "unformatted" all code beside the expression language is ignored.

Do you guys have another ideia or plugin to use with sublimeText 3?

like image 347
Leonardo Mascarenhas Avatar asked Dec 24 '14 11:12

Leonardo Mascarenhas


People also ask

How do I get the Beautify code in Sublime Text 3?

Beautify on Save sublime-settings : Ctrl+Shift+P or Cmd+Shift+P in Linux/Windows/OS X.

How do I arrange codes in Sublime Text?

To organize code with Sublime Text you have to CRTL + Shift + P and search for "reindent lines" That should reindent and make HTML code nice and organized. Code Fold is also possible and can be done by hovering over the line number on a parent or subparent element and clicking on the triangle symbol.


1 Answers

I havent had a problem with https://github.com/samholmes/EJS.tmLanguage (though I use Jade over EJS so dont use it as much). You can install it with Sublime Text Package Control, the package is named "EJS".

You may need to swap open .ejs files from "Plain Text" (or whatever your default type is) to "EJS <% and %>".

like image 199
Todd Avatar answered Oct 19 '22 21:10

Todd