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
...
相关推荐
爱就是恒久忍耐12 天前
VSCode里如何比较2个branch
ide·vscode·编辑器
意法半导体STM3212 天前
【官方原创】如何为STM32CubeMX2配置Visual Studio Code配置方案
vscode·stm32·单片机·嵌入式硬件·策略模式·stm32cubemx·嵌入式开发
bloglin9999912 天前
vscode中可视化的合并分支,在“合并编辑器中解析”中“与基线进行比较”是什么意思
ide·vscode·编辑器
天疆说12 天前
在 Ubuntu 的 VSCode 中配置 MATLAB
vscode·ubuntu·matlab
春日见13 天前
vscode的AI编程插件推荐:
大数据·ide·vscode·算法·机器学习·编辑器·ai编程
jieshenai13 天前
VScode sys.path,并使CTRL+左键可访问源码
ide·vscode·编辑器
qq_4480111613 天前
VSCode环境搭建
ide·vscode·编辑器
qq_3384323713 天前
VSCode Remote-SSH 远程 Windows Server 卡死的排查与解决
windows·vscode·ssh
console.log('npc')13 天前
Codex 桌面端接入 Headroom 压缩代理完整教程
前端·vscode
女神下凡14 天前
这是 Cursor(Composer) 的五种核心交互模式
服务器·人工智能·windows·vscode·microsoft