I've been trying to setup cc-mode based files to behave in the way I want, but with so many varying opinions and suggested ways of doing things, I've not been able to get things just right.
All I want to be able to do is the following:
void foo() {
if (something) {
doSomethingElse();
while (bar()) {
zap();
}
}
else {
orSomeOther();
}
}
- Opening braces should be on the same line.
- When I hit Return after I enter the opening brace, the cursor should move to the next line, and indent.
- Indentation should be using tabs, each with a width of 3.
- When I hit Return after entering the opening brace on the line with the
while
, the cursor should be placed where thez
inzap()
is. - When I do hit Return after opening braces, the closing brace should be added under the blank line where we've just indented and the cursor is now waiting for me to continue typing.