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
...
相关推荐
程序员龙一2 小时前
VsCode+ClaudeCode+Deepseek的配置
vscode·claude·deepseek·vibecoding
cgblpx1 天前
vscode的安装
ide·vscode·编辑器
golang学习记2 天前
Zed 新特性:AI 还在跑,电脑可以不睡了
人工智能·vscode·电脑·zed
瑶山2 天前
Windows + WSL2 Ubuntu + VS Code配置C++开发环境
开发语言·c++·windows·vscode·wsl
golang学习记3 天前
VSCode多光标迎来重大更新
ide·vscode·编辑器
专业程序开发源3 天前
flask家电故障预测系统92491-计算机课程设计/毕业设计
vscode·python·sql·算法·flask·课程设计
Vex2une3 天前
PowerShell ISE 到 VS Code 迁移史:从集成脚本环境到现代编辑器工作流
windows·vscode·powershell·powershell ise·powershell 扩展·powershell 7·脚本编辑器
小李不困还能学3 天前
VSCode远程开发免密码登录
ide·vscode·编辑器
*wait for?5 天前
VScode使用uv-创建python虚拟环境
ide·vscode·编辑器
意法半导体STM325 天前
【官方原创】LAT1724 STM32CubeIDE for VSCode 修改链接文件中的起始地址无效?
vscode·stm32·单片机·嵌入式硬件·mcu·stm32cube