Is there any way to to automatically insert spaces between function definitions. E.g. my initial sources are:
void
func1()
{
// func1 body.
}
void
func2()
{
// func2 body.
}
I would like it to be reformatted to:
void
func1()
{
// func1 body.
}
void
func2()
{
// func2 body.
}
And if there are more line breaks, fixed number of them should be kept.
As mentioned in this answer with clang-format 14, you can use the following in your config file:
The other possible values are
Leave
, to leave the spacing of definition blocks as-is, orNever
, to remove empty lines between definition blocks.