Featured image of post 相关配置 | sublime-text中clang-format插件的配置

相关配置 | sublime-text中clang-format插件的配置

sublime-text中clang-format插件的配置

Custom style

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
    "BasedOnStyle": "Google",
    "IndentWidth": 4,
    "AlignAfterOpenBracket": true,
    "AlignConsecutiveAssignments": true,
    //# 连续声明时,对齐所有声明的变量名
    "AlignConsecutiveDeclarations": false,
    "MaxEmptyLinesToKeep": 4,
    "BreakBeforeBraces": "Attach",
    "AllowShortIfStatementsOnASingleLine": true,
    "IndentCaseLabels": true,
    "ObjCBlockIndentWidth": 4,
    "ObjCSpaceAfterProperty": true,
    "ColumnLimit": 0,
    "AlignTrailingComments": true,
    "SpaceAfterCStyleCast": true,
    "SpacesInParentheses": false,
    "SpacesInSquareBrackets": false,
    "TabWidth": 4,
    "UseTab": "Never",
    "AllowShortBlocksOnASingleLine": false,
    "AllowShortIfStatementsOnASingleLine": true,
    "AllowShortLoopsOnASingleLine": true,
    "BraceWrapping":{
        "AfterClass":             false,
        "AfterControlStatement":  false,
        "AfterEnum":              false,
        "AfterFunction":          false,
        "AfterNamespace":         false,
        "AfterObjCDeclaration":   false,
        "AfterStruct":            false,
        "AfterUnion":             false,
        "BeforeCatch":            false,
        "BeforeElse":             false,
        "IndentBraces":           false,
        "SplitEmptyFunction":     true,
        "SplitEmptyRecord":       true,
        "SplitEmptyNamespace":    true
    },
    "Cpp11BracedListStyle": true,
    "ColumnLimit": 80,
}

User setting

1
2
3
4
5
6
{
    "binary": "D:\\LLVM\\bin\\clang-format.exe",
    "style": "Custom",
    "format_on_save": true,
    "languages": ["C", "C++"]
}
Licensed under CC BY-NC-SA 4.0
使用 Hugo 构建
主题 StackJimmy 设计