SEGGER Embedded Studio for 自动统一代码格式
Tool -> Options -> Text Editor -> Formatting

配置选项:

配代码参考格式链接:Clang-Format Style Options — Clang 20.0.0git documentation (llvm.org)
AlignConsecutiveAssignments: Consecutive
AlignEscapedNewlinesLeft: Left
AlignOperands: DontAlign
AlignTrailingComments:
Kind: Always
OverEmptyLines: 2
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
ColumnLimit: 120
PackConstructorInitializers: CurrentLine
DerivePointerAlignment: true
IndentCaseLabels: false
KeepEmptyLinesAtTheStartOfBlocks: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
SpacesBeforeTrailingComments: 4
Standard: Auto
多种格式选择:

本文来自博客园,作者:求隐,转载请注明原文链接:https://www.cnblogs.com/duguqiuying/articles/18396037

浙公网安备 33010602011771号