Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML syntax highlighting in FreeMarker/Velocity on Intellij

Intellij IDEA is already very good at syntax highlighting .vm Velocity files or independent .html files. But very often one uses template engines to create something in HTML format. Is there any way to enable this mixed mode syntax highlighting, like the one we have for JSP technology?

like image 460
Saintali Avatar asked Sep 20 '25 07:09

Saintali


2 Answers

I was not able to assign syntax highlighting using "File Type" option as mentioned in the doc as "FreeMarker Template" language was not available in the language dropdown.

So I followed this doc to assign a file type on a file name extension using below steps:

  1. Go to the file in the file tree.
  2. Right click on the file.
  3. Click on the option Associate with File Type or choose File | File Properties | Associate with File Type from the main menu.
  4. Enter file pattern if not auto populated.
  5. Choose language "FreeMarker Templates" from the language dropdown under "Open matching files in IntelliJ IDEA" option.
  6. Click OK
like image 90
Shivam Sharma Avatar answered Sep 21 '25 22:09

Shivam Sharma


Did you specify the language for your templates?

like image 28
CrazyCoder Avatar answered Sep 22 '25 00:09

CrazyCoder