Tim
Tim

Reputation: 4365

Eclipse - autoformatting of code

This might be nitpicky, but I like all my code to be in the form

function()
{
   code
}

instead of

function() {
   code
}

When Eclipse autogenerates a class for me, it will use the latter format, and so I have to go through and change all of the generated methods. Is there anyway to make it so it will put it in the first format automatically? I'm using java if that makes a difference.

Upvotes: 4

Views: 157

Answers (2)

Java42
Java42

Reputation: 7706

Click "edit" on the following panel to control the formatter:

enter image description here

Upvotes: 9

JohnnyK
JohnnyK

Reputation: 1102

Yup. Look in Preferences -> Java -> Cody Style -> Formatter. you can alter a BUNCH of styles in there.

I think what you're looking for is in the Braces tab

Upvotes: 4

Related Questions