sudo  apt-get  install  clang-format
搜索 Clang-Format 安装
粘贴/保存时自动格式化
clang-format  -style = llvm -dump-config >  ~/xx/xx/.clang-format
--- 
Language :         Cpp
AccessModifierOffset :  -2 
AlignConsecutiveAssignments :  true 
AlignEscapedNewlines :  Left
AlignTrailingComments :  true 
AllowShortBlocksOnASingleLine :  true 
AllowShortCaseLabelsOnASingleLine :  true 
AllowShortFunctionsOnASingleLine :  All
AllowShortIfStatementsOnASingleLine :  true 
AllowShortLoopsOnASingleLine :  true 
AlwaysBreakAfterReturnType :  None
AlwaysBreakBeforeMultilineStrings :  false 
AlwaysBreakTemplateDeclarations :  MultiLine
BinPackArguments :  false 
BinPackParameters :  false 
BreakBeforeBraces :  Custom
BraceWrapping : AfterClass :       false AfterControlStatement :  false AfterEnum :        false AfterFunction :    false AfterNamespace :   false AfterObjCDeclaration :   false AfterStruct :      false AfterUnion :       false AfterExternBlock :  false BeforeCatch :      false BeforeElse :       false IndentBraces :     false SplitEmptyFunction :  false SplitEmptyRecord :  false SplitEmptyNamespace :  false 
BreakBeforeBinaryOperators :  All
BreakBeforeTernaryOperators :  true 
BreakInheritanceList :  BeforeColon
BreakConstructorInitializers :  BeforeComma
BreakAfterJavaFieldAnnotations :  false 
BreakStringLiterals :  true 
ColumnLimit :      120 
CommentPragmas :   '^ IWYU pragma:' 
CompactNamespaces :  false 
ConstructorInitializerAllOnOneLineOrOnePerLine :  false 
ConstructorInitializerIndentWidth :  2 
ContinuationIndentWidth :  2 
Cpp11BracedListStyle :  false 
DerivePointerAlignment :  false 
DisableFormat :    false 
ExperimentalAutoDetectBinPacking :  false 
FixNamespaceComments :  false 
ForEachMacros :    -  foreach-  Q_FOREACH-  BOOST_FOREACH
IncludeBlocks :    Preserve
IncludeCategories :  -  Regex :            '^"(llvm|llvm-c|clang|clang-c)/' Priority :         2 -  Regex :            '^(<|"(gtest|gmock|isl|json)/)' Priority :         3 -  Regex :            '.*' Priority :         1 
IncludeIsMainRegex :  '(Test)?$' 
IndentCaseLabels :  true 
IndentPPDirectives :  None
IndentWidth :      2 
IndentWrappedFunctionNames :  false 
JavaScriptQuotes :  Leave
JavaScriptWrapImports :  true 
KeepEmptyLinesAtTheStartOfBlocks :  true 
MacroBlockBegin :  '' 
MacroBlockEnd :    '' 
MaxEmptyLinesToKeep :  1 
NamespaceIndentation :  Inner
ObjCBinPackProtocolList :  Auto
ObjCBlockIndentWidth :  2 
ObjCSpaceAfterProperty :  true 
ObjCSpaceBeforeProtocolList :  true 
PenaltyBreakAssignment :  2 
PenaltyBreakBeforeFirstCallParameter :  19 
PenaltyBreakComment :  300 
PenaltyBreakFirstLessLess :  120 
PenaltyBreakString :  1000 
PenaltyBreakTemplateDeclaration :  10 
PenaltyExcessCharacter :  1000000 
PenaltyReturnTypeOnItsOwnLine :  60 
PointerAlignment :  Right
ReflowComments :   true 
SortIncludes :     true 
SortUsingDeclarations :  false 
SpaceAfterCStyleCast :  false 
SpaceAfterTemplateKeyword :  true 
SpaceBeforeAssignmentOperators :  true 
SpaceBeforeCpp11BracedList :  true 
SpaceBeforeCtorInitializerColon :  true 
SpaceBeforeInheritanceColon :  true 
SpaceBeforeParens :  ControlStatements
SpaceBeforeRangeBasedForLoopColon :  true 
SpaceInEmptyParentheses :  false 
SpacesBeforeTrailingComments :  1 
SpacesInAngles :   false 
SpacesInContainerLiterals :  false 
SpacesInCStyleCastParentheses :  false 
SpacesInParentheses :  false 
SpacesInSquareBrackets :  false 
Standard :         Cpp11
TabWidth :         2 
UseTab :           Never