Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clang-format function argument indent

Tags:

clang-format

Is there a way to configure clang-format to behave in this way? Notice how each parameter is on its own line and is indented by only 1 level as opposed to aligned with the function name. This is my preferred coding style, but I just can't get clang-format to do this.

int a_very_long_function_name(
    int var_a,
    double my_b,
    char *str
) {
    int d = 0;
    /* ... */
    return d;
}
like image 995
Kyle Avatar asked Jun 29 '26 02:06

Kyle


1 Answers

Should be possible now according to: https://clang.llvm.org/docs/ClangFormatStyleOptions.html

AlignAfterOpenBracket: BlockIndent

like image 103
Jonny Soe Avatar answered Jul 01 '26 19:07

Jonny Soe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!