Skip to content

Instantly share code, notes, and snippets.

@H1rono
Created November 21, 2022 22:08
Show Gist options
  • Save H1rono/ad33f89c2b7c1cd139809f3273b8ec8d to your computer and use it in GitHub Desktop.
Save H1rono/ad33f89c2b7c1cd139809f3273b8ec8d to your computer and use it in GitHub Desktop.
my favorite clang-format configuration
BasedOnStyle: WebKit
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: Right
AlignOperands: Align
AllowShortFunctionsOnASingleLine: Empty
AllowShortLambdasOnASingleLine: Empty
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBraces: Attach
BreakConstructorInitializers: AfterColon
BreakStringLiterals: false
ColumnLimit: 100
PointerAlignment: Middle
SpaceBeforeCpp11BracedList: false
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: false
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
BeforeNonEmptyParentheses: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment