Actually we have freemarker files (ftl) under Eclipse + Freemarker plugin (from JBoss).
Do you know a way to format ftl files ?
Thanks
For ftl files that represent HTML configuring eclipse to open the HTML Editor works nicely. The HTML Editor has formatting capability as asked for. Todo configure eclipse to open ftl files with the HTML Editor you can use "open with" and there you'll get offered to link the HTML Editor permanently to the ftl extension:
In the Content Types Preferences Page you can than actually add the *.ftl extension:
I looked for a formatting tool a few months ago and I was unable to find any such tools. To my knowledge there no such tools currently available, just the syntax highlighting you mentioned.
Associated the ftl file extension with your web page editor (assuming you have wtp already installed).
An old question. I had the same problem for some time now, the default html editor contains some irritating features when working on freemarker templates, especially when using the bracket syntax.
Aptana studio eclipse plugin solves most of the problems:
http://www.aptana.com/products/studio3/download
Related
I just upgraded to Eclipse 2020-09 (4.17.0) from Eclipse Luna. After installing, I installed Eclipse Web Developer Tools 3.19 from the Marketplace, then restarted Eclipse. When I open a .js file, there is no syntax highlighting. It was fine out of the box with Luna, so is there anything extra that I need to configure in 2020-09? File associations for *.js shows this:
It seems JavaScript files (*.js) have been associated with the plain text editor instead of the Generic Text Editor by mistake (please make sure it has been reported to Eclipse).
Right-click the file and choose Open With > Generic Text Editor.
Or better, associate all *.js files with the Generic Text Editor by right-click a *.js file, choose Open With > Other..., select the Generic Text Editor in the list and tick the Use it for all '.js' files* checkbox at the bottom (as shown in my video here).
Yes, you need to install the Wild Web Developer feature so that it provides that functionality through the Generic Text Editor.
I am trying to use Tern Eclipse IDE in a static web project. Alas, I'm not able to configure it to validate javascript in script tags in .html files. Is this even supported? Is there any doc how to do it?
I installed Freemarker ide from eclipse market place for Spring tool suite. I installed Freemarker from "Jboss tools for Luna" in eclipse market place. After installing it only highlights the Freemarker experssion ${}. Other html elmements are not highlighting. Why this happen?
HTML was never highlighted by the JBoss FreeMarker IDE, only FreeMarker tags (like <#if ...>). (Contributions are highly welcome...)
This is my temporary solution: edit 'File Association' to open FTL with SublimeText. The FreeMarker plugin in Sublime is really good. And as long as you keep the FTL file opened in Eclipse/STS, any change made in Sublime will trigger the FileSync immediately.
I did also cope with this problem by changing 'Content Types' and 'File Associations' in 'Preference'. But either using JSP or HTML editor the FTL code won't be highlighted.
Lately I have started to explore Ember.js, from their site I understood that there is a good synergy between Ember and Handlebars language.
I wondered if there is any editor (plugin) that can help me with handlebars auto-completion and coloring.
If you are using handlebars as .hbs files (no script tag) you can enable syntax highlight by configuring 2 settings: the editor and content types:
Eclipse -> Preferences -> General -> Content_Types
add *.hbs under html
Eclipse -> Preferences -> General -> Editor -> File Associations
Add *.hbs to html editor.
Close the editor and re-open it
[optional] If still not highlight (old eclipse versions) restart eclipse.
This works for aptana and zend studio as well
If you use Sublime Text 2, there is a great Handlebars package for syntax highlighting, etc.
https://github.com/nrw/sublime-text-handlebars
TextMate version:
https://github.com/drnic/Handlebars.tmbundle
It can be installed manually or with the Sublime Text 2 package manager.
IntelliJ IDEA (an alternative to Eclipse) has a handlebars plug-in. For Emblem, a Haml-like version of Handlebars, the nearest plug-in would be Slim.
Using the Eclipse keybinding Shift-Ctrl+F (Format) in Python (with help from PyDev), Javascript or plain HTML files works as expected.
Jinja2 templates however, become a mess. Is there a solution to solve or easily work around this?
As Jinja2 seems very close to Django templates, it may be worth using the Django templates editor (it's distributed along with Aptana Studio 3 -- you just have to change the file association to open html files with that editor in the file association).