Visual Code C/C++ formatting of braces {}

Viewed 286

In VSCode, I wanted my opening curly braces { to be in the same line, instead of a new line and for that I changed C_Cpp.clang_format_fallbackStyle from Visual Studio to LLVM, which seemed to work.

But it does this thing which I don't want, which is it formats my if-else statements like this:

if (condition){
    do_something()
} else {
    do_something_else()
}

Instead, I want it to be like this:

if (condition){
    do_something()
} 
else {
    do_something_else()
}

Basically I want each closing bracket to be on it's on line, whether it's for if-else statements or try-catch, or whatever. How do I do that?

1 Answers
Related