Astyle对应.clang-format

复制代码
---
Language: Cpp

# 基础风格
BasedOnStyle: LLVM

# BSD / Allman 风格括号
BreakBeforeBraces: Allman

# 缩进
IndentWidth: 4
TabWidth: 4
UseTab: Never

# namespace 缩进
NamespaceIndentation: All

# class 访问修饰符缩进
AccessModifierOffset: -4
IndentAccessModifiers: false

# switch/case
IndentCaseLabels: false
IndentCaseBlocks: false

# 预处理
IndentPPDirectives: None

# 指针与引用
PointerAlignment: Right
ReferenceAlignment: Pointer

# 空格
SpaceBeforeParens: ControlStatements
SpacesInParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true

# 运算符对齐
AlignOperands: Align

# 连续赋值不对齐
AlignConsecutiveAssignments: None

# 括号换行
BreakBeforeBinaryOperators: None

# 一行语句
AllowShortBlocksOnASingleLine: Always
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline

# else if 保持同一行
BeforeElse: false

# 模板 >>
SpacesInAngles: Never

# 空行
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1

# 注释
ReflowComments: false

# 行宽
ColumnLimit: 0

# 多行条件缩进
ContinuationIndentWidth: 8

# include 排序
SortIncludes: false

# C++11
Standard: c++11
...
相关推荐
iCxhust1 天前
8088单板机VScode集成开发环境使用方法
ide·笔记·vscode·编辑器·微机原理·8088单板机
如何原谅奋力过但无声2 天前
现代化Python工具:uv、Ruff、Pyright、Rich(只讲重点版)
vscode·python·uv
Molesidy2 天前
【VSCode】基于win10系统老版本和VSCode最新版本下出现的VSCode内置的终端窗口不能运行的问题的解决方案
ide·vscode·编辑器
James5062 天前
VSCode+CodeX扩展,无法启动
ide·vscode·codex
W_chuanqi3 天前
VSCode + Claude Code + DeepSeek:打造 AI 编程神器
ide·vscode·编辑器·ai编程
csdn_aspnet3 天前
在 Visual Studio Code 中安装使用 Github Copilot
ide·vscode·github·copilot
New_Horizons6663 天前
远程linux终端中支持vscode的code命令
ide·vscode·编辑器
2501_915918413 天前
免 Xcode 开发 iOS,工具链替代方案与编译、签名、安装
ide·vscode·macos·ios·个人开发·xcode·敏捷流程
阿米亚波3 天前
【C/C++包管理器】vcpkg(by microsoft)
c语言·c++·git·vscode·microsoft·github·vcpkg
AttackingLin5 天前
VScode Claude Code 插件配置第三方api
ide·vscode·编辑器