Skip to content

Instantly share code, notes, and snippets.

@gboncoffee
Created September 21, 2024 21:15
Show Gist options
  • Save gboncoffee/e4de78a91b39601cc1e69dbc5e38807e to your computer and use it in GitHub Desktop.
Save gboncoffee/e4de78a91b39601cc1e69dbc5e38807e to your computer and use it in GitHub Desktop.
Making C code pretty
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveDeclarations: Consecutive
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Right
AlignOperands: DontAlign
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: All
AlwaysBreakBeforeMultilineStrings: true
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: After
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakStringLiterals: true
ColumnLimit: 80
ContinuationIndentWidth: 4
IncludeBlocks: Regroup
IndentCaseLabels: false
IndentGotoLabels: false
IndentPPDirectives: BeforeHash
IndentWidth: 4
MaxEmptyLinesToKeep: 1
PPIndentWidth: 2
PointerAlignment: Left
QualifierAlignment: Custom
QualifierOrder: [static, volatile, inline, const, restrict, type]
ReflowComments: false
SeparateDefinitionBlocks: Always
SortIncludes: CaseInsensitive
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeParens: ControlStatements
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 1
SpacesInContainerLiterals: true
SpacesInSquareBrackets: false
UseTab: Never
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
[*{.c,.h}]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment