Reputation: 3019
I am trying to change up the IntelliJ code formatting options to improve the clarity and readability of my code. Two problems I have come across are the following:
1) Creating columns in an array. What I have:
private int[][] c = new int[][]{
{1, 2, 3},
{100, 200, 300}
};
What I would want:
private int[][] c = new int[][]{
{ 1, 2, 3},
{100, 200, 300}
};
2) Aligning parenthesis on multiple lines in binary operations. What I have:
final int argb = (red << 0) |
(green << 8) |
(blue << 16) |
(alpha << 24);
What I would want:
final int argb = (red << 0) |
(green << 8) |
(blue << 16) |
(alpha << 24);
If anyone knows of any way this can be done, that would be greatly appreciated. I did not see any options available that seemed to have worked. Maybe there is a weird combination I need. I can provide the current Code Style settings I have. Thanks for the help.
Upvotes: 3
Views: 1940
Reputation: 9402
There's a plugin for that, called Tabifier, available in the default plugin repository. It haasn't been updated in 3 years, but it seems to still work.
It has extensive configuration and does a lot of controversial layouts, so I recommend turning most of its features off at first, and then slowly enable ones that you need.
The main downside is that the default Reformat Code action ignores whatever Tabifier did, so you would have to manually retabulate chunks of code from time to time
Upvotes: 3