Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Treat One File Type Like Another in Eclipse for Formatting and Syntax Highlighting?

We are currently using Apache Velocity and some of the files are just standard HTML files but have the extension .vm which means that they aren't recognized as HTML files and hence don't have syntax highlighting etc.

Is there a way to force a certain file type extension to be treated as another file type within Eclipse? For example our .vm files to be treated like .html files so correct syntax highlighting and code formatting is used by Eclipse.

Is there a built in way to do this or would I need to get a plugin to add this type of functionality?

like image 450
ma3574 Avatar asked Sep 29 '22 20:09

ma3574


1 Answers

Add *.vm to the HTML content type in Window -> Preferences -> General -> Content Types.

setting a content type

Then associate the file type with an editor in Window -> Preferences -> Editors -> File Associations. The default editors for HTML files are associated automatically by the content type.

associate with editor

like image 103
Modus Tollens Avatar answered Oct 08 '22 19:10

Modus Tollens