Reading the docs, I came up with this:
# Add or remove newline between a function name and the opening '('
nl_func_paren = remove # ignore/add/remove/force
# Add or remove newline between a function name and the opening '(' in the definition
nl_func_def_paren = remove # ignore/add/remove/force
# Add or remove newline after '(' in a function declaration
nl_func_decl_start = remove # ignore/add/remove/force
# Add or remove newline after '(' in a function definition
nl_func_def_start = remove # ignore/add/remove/force
# Add or remove newline after each ',' in a function declaration
nl_func_decl_args = remove # ignore/add/remove/force
# Add or remove newline after each ',' in a function definition
nl_func_def_args = remove # ignore/add/remove/force
# Add or remove newline before the ')' in a function declaration
nl_func_decl_end = remove # ignore/add/remove/force
# Add or remove newline before the ')' in a function definition
nl_func_def_end = remove # ignore/add/remove/force
As you anticipate, the comments kind-of ruin it, though. There is an option to change single-line comments (//
) into block comments (/* ... */
) though, which should make it easier for you to join lines manually (e.g. in vim v%J
)
# Whether to change cpp-comments into c-comments
cmt_cpp_to_c = true # false/true
I tested it with prototypes, declarations and calls:
The calls are not affected. Note also the following related option:
# Whether to fully split long function protos/calls at commas
ls_func_split_full = false # false/true