编译器设置和代码样式设置

{
   
  "code-runner.executorMap": {
   
    "cpp": "/usr/bin/g++ -std=c++2a -o $fileNameWithoutExt $fileName && ./$fileNameWithoutExt"
  },
  "code-runner.runInTerminal": true,
  "editor.fontSize": 16,
  "editor.fontLigatures": true,
  "editor.fontFamily": "Fira Code, Menlo, 'Courier New', monospace",
  "editor.bracketPairColorization.enabled": false,
  "files.associations": {
   
    "ios": "cpp"
  },
  "C_Cpp.errorSquiggles": "disabled",
  "workbench.colorCustomizations": {
   
    "[Xcode Classic (Dark)]": {
   
      "editor.background": "#383838",
      "editor.foreground": "#EAEAEA",
      "editorLineNumber.foreground": "#82888f",
      "editorLineNumber.activeForeground": "#869ef3",
      "editorCursor.foreground": "#ffffff",
      "editor.selectionBackground": "#515b70",
      "editorBracketMatch.background": "#383a60",
      "editorBracketMatch.border": "#ffef28"
    }
  },
  "editor.tokenColorCustomizations": {
   
    "[Xcode Classic (Dark)]": {
   
      "textMateRules": [
        // 注释
        {
   
          "scope": [
            "comment",
            "comment.line",
            "comment.block"
          ],
          "settings": {
   
            "foreground": "#5dd787"
          }
        },
        // 关键字
        {
   
          "scope": [
            "keyword",
            "keyword.control",
            "storage.type"
          ],
          "settings": {
   
            "foreground": "#fc5fa3",
            "fontStyle": "bold"
          }
        },
        // 字符串
        {
   
          "scope": [
            "string"
          ],
          "settings": {
   
            "foreground": "#fc6a5d"
          }
        },
        // 数字
        {
   
          "scope": [
            "constant.numeric"
          ],
          "settings": {
   
            "foreground": "#d0bf69"
          }
        },
        // 函数
        {
   
          "scope": [
            "entity.name.function",
            "support.function"
          ],
          "settings": {
   
            "foreground": "#67b7a4"
          }
        },
        // 类名
        {
   
          "scope": [
            "entity.name.type.class",
            "entity.name.type"
          ],
          "settings": {
   
            "foreground": "#5dd8ff" // DEFAULT_CLASS_NAME
          }
        },
        // 变量
        {
   
          "scope": [
            "variable",
            "variable.parameter"
          ],
          "settings": {
   
            "foreground": "#EAEAEA"
          }
        },
        // 常量
        {
   
          "scope": [
            "constant"
          ],
          "settings": {
   
            "foreground": "#a167e6"
          }
        },
        // 括号
        {
   
          "scope": [
            "punctuation.section.block",
            "punctuation.definition.begin",
            "punctuation.definition.end",
            "meta.brace"
          ],
          "settings": {
   
            "foreground": "#EAEAEA"
          }
        },
        {
   
          "scope": [
            "keyword", // 通用关键字
            "keyword.control", // 控制流关键字 (if/else/for/while)
            "keyword.operator", // 操作符 (typeof/instanceof)
            "storage.type", // 类型关键字 (var/let/const)
            "storage.modifier" // 修饰符 (async/await)
          ],
          "settings": {
   
            "fontStyle": "" // 取消加粗和斜体
          }
        },
        {
   
          "scope": [
            "keyword.operator", // 通用操作符
            "keyword.operator.arithmetic", // 算术操作符 (+ - * / %)
            "keyword.operator.comparison", // 比较操作符 (== != > <)
            "keyword.operator.logical", // 逻辑操作符 (&& || !)
            "keyword.operator.assignment", // 赋值操作符 (= += -=)
            "keyword.operator.bitwise", // 位操作符 (& | ^ ~)
            "punctuation.separator", // 分隔符 (如 . , ; :)
            "punctuation.accessor" // 访问符 (如 . ?.)
          ],
          "settings": {
   
            "foreground": "#EAEAEA", // 设置颜色为 #EAEAEA
            "fontStyle": "" // 可选:取消加粗/斜体
          }
        },
        {
   
          "scope": [
            "punctuation.terminator.statement",  // 分号的主要作用域(适用于大多数语言)
            "punctuation.separator"              // 某些语言的分号作用域
          ],
          "settings": {
   
            "foreground": "#EAEAEA"              // 设置分号颜色
          }
        }
      ]
    }
  }
}

clang-format格式设置

# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignOperands: Align
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Always
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom
BraceWrapping:
  AfterCaseLabel: false
  AfterClass: false
  AfterControlStatement: Never
  AfterEnum: false
  AfterFunction: false
  AfterNamespace: false
  AfterUnion: false
  BeforeCatch: false
  BeforeElse: true
  IndentBraces: false
  SplitEmptyFunction: false
  SplitEmptyRecord: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 0
CompactNamespaces: false
ContinuationIndentWidth: 8
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Right
ReflowComments: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 0
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: ForIndentation