Only want to ever see Allman style code and save K&R style code

Viewed 9234

One of our developers decided he'd dictate to other developers how people should format their source code.

Myself, I'm a firm believer that Allman style indentation is better than K&R.

Formatting styles is like religion, there are always those that disagree. No matter how much evidence is shown that one is better than the other, people will not accept it.

So what I want to do, is every time I open a file in Eclipse, I have it format the source code, so that I can look at pretty code. Every time I save, it should format to the dictated style in the office.

I think I'm ok with doing this manually and having two hot-keys for it. Ctrl-Alt-PgUp: my way Ctrl-Alt-PgDown: high way

The hot key option is probably good because then I get to verify all is well instead of it happening invisibly behind the scenes.

Eclipse has a single format option. What I need is two formatting styles and map them each to a shortcut key. Is that possible, and if so, how?

3 Answers
Related