Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Has anyone gotten code formatting (Ctrl+Shift+F) to work in Eclipse? I know it's basically a Java feature but it would be neat to format Apex code according to rules.

I also can't get some hotkeys like "Insert Block Comment" to work - any specialities there?

share|improve this question
up vote 4 down vote accepted

Code formatting (as well as some of the other common Java features) is not supported in the IDE, unfortunately.

At one point I looked into adding some of the features I miss from Javaland, and determined it wouldn't be tons of work (the Eclipse API is very well documented) but too much time to justify for purely personal use.

share|improve this answer
Would a 3rd party plugin work in Apex? – Marc Feb 1 '13 at 6:49
It would be in Eclipse, not in Apex per se, so yes. Eclipse is designed with an open plugin architecture. At worst it would require implementing a new type of Editor from scratch that implemented the features you wanted. Still, not worth the individual effort IMO. You may also want to take a look at BrainEngine. – jkraybill Feb 5 '13 at 1:15
Thanks for the BrainEngine tip! Eclipse is driving me crazy and I'm ready to pay good money for something productive! – Marc Feb 5 '13 at 10:26

This is currently not supported out of the gate with the IDE. If you would like it to be supported, I would suggest voting on it in Ideas -

Although I have no personally gotten this working, this Community post - - suggests checking out this -

Hopefully some of that can help you out.

share|improve this answer

No. Coding formatting (Ctrl+Shift+F) is not supported by eclipse plugin.

share|improve this answer

Disclaimer - I use both Eclipse and MavensMate plugin and I'm not endorsing either. You might also want to look at the MavensMate plugin if you use SublimeText

It provides code formatting as well as a number of other interesting features.

share|improve this answer
Obviously I would want something which works in Eclipse :-) Most IDEs allow you to run external .exes (e.g. JSHint) on your source. I might follow that up. – Marc Feb 1 '13 at 13:15
I'm pretty sure MavensMate does not provide code formatting. It can do Apex language auto-completions, but does not provide reformatting or auto-indenting capabilities for Apex. – Harmon Mar 30 at 1:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.