VScode c/c++代码格式化配置
1.下载C/C++ 插件

2.按“ctrl + ,”打开设置
3.搜索“clang_format_style”
4.填入格式信息
{
BasedOnStyle: LLVM,
IndentWidth: 4,
BreakBeforeBraces: Custom,
BraceWrapping: {
AfterFunction: true,
AfterControlStatement: false
},
AllowShortFunctionsOnASingleLine: false,
ColumnLimit: 180,
AllowShortIfStatementsOnASingleLine: true,
AlignConsecutiveMacros: true,
AlignConsecutiveAssignments: true,
AlignTrailingComments: {
Kind: Always,
OverEmptyLines: 0
}
}
浙公网安备 33010602011771号