Skip to content

Instantly share code, notes, and snippets.

@olehermanse
Created March 19, 2018 16:31
Show Gist options
  • Save olehermanse/828838a3f8ec5df06d0acb75b0178ff0 to your computer and use it in GitHub Desktop.
Save olehermanse/828838a3f8ec5df06d0acb75b0178ff0 to your computer and use it in GitHub Desktop.
My current clang-format config for C
---
BasedOnStyle: Google
---
Language: Cpp
ColumnLimit: 78
IndentWidth: 4
TabWidth: 4
UseTab: Never
MaxEmptyLinesToKeep: 3
AlignTrailingComments: true
SpacesBeforeTrailingComments: 1
DerivePointerAlignment: false
PointerAlignment: Right
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
BreakStringLiterals: false
BinPackArguments: false
BinPackParameters: false
AlignAfterOpenBracket: AlwaysBreak
AllowAllParametersOfDeclarationOnNextLine: true
IndentCaseLabels: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: false
BreakBeforeBraces: Allman
BraceWrapping:
AfterControlStatement: true
AfterFunction: true
AfterStruct: true
AfterUnion: true
AfterEnum: true
BeforeElse: true
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment