I currently use astyle -A8 -t8 -p -j <filename>
to format the code in my C project.
Is there a way to configure my .vimrc
to follow the continuation line format that the above demands? For example astyle
formats the below function call:
my_function(first_arg,
<tab>second_arg,
<tab>third_arg);
(which is the default indentation when I hit Enter
) as
my_function(first_arg,
second_arg,
third_arg);
I saw in cinoptions-values
there was something close:
*cino-+*
+N Indent a continuation line (a line that spills onto the next)
inside a function N additional characters. (default
'shiftwidth').
Outside of a function, when the previous line ended in a
backslash, the 2 * N is used.
cino= cino=+10 >
a = b + 9 * a = b + 9 *
c; c;
But that only aligns to a specific number of spaces. Is there a way to align it like the astyle
example above?