Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marcelohmariano/2aa9935e8d176b0f125c80e5796c5dc5 to your computer and use it in GitHub Desktop.
Save marcelohmariano/2aa9935e8d176b0f125c80e5796c5dc5 to your computer and use it in GitHub Desktop.
Google based C++ style to use with ClangFormat
#!/bin/bash
clang-format -style="{\
BasedOnStyle: Google, \
AccessModifierOffset: -2, \
AlignEscapedNewlines: DontAlign, \
AlignTrailingComments: false, \
AllowShortFunctionsOnASingleLine: Inline, \
AllowShortIfStatementsOnASingleLine: false, \
AllowShortLoopsOnASingleLine: false, \
AlwaysBreakBeforeMultilineStrings: false, \
BreakBeforeBinaryOperators: NonAssignment, \
ColumnLimit: 0, \
DerivePointerAlignment: false, \
IndentWidth: 4, \
KeepEmptyLinesAtTheStartOfBlocks: true, \
SpacesInContainerLiterals: false, \
TabWidth: 4 \
}" -dump-config > .clang-format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment