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
...
相关推荐
xx~t6 小时前
嵌入式——Linux软件编程——网络1
linux·c语言·网络·vscode·网络协议
逐步前行12 小时前
ESP32-S3-VSCode扩展ESP-IDF
ide·vscode·编辑器
2501_9160088915 小时前
Flutter 开发 iOS,项目打包成 IPA,命令与免 Xcode两种方法
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
witton3 天前
MacOS中在目录或者文件右键菜单中添加“使用VSCode打开”
vscode·macos·文件·目录·服务·automator·右键菜单
码上暴富4 天前
Cursor / VS Code 自定义文件颜色
前端·vscode
2601_962381584 天前
VSCode如何配置LlamaIndex RAG(检索增强生成)应用开发环境
vscode·开发环境·rag·llamaindex·检索增强生成
北漂燕郊杨哥4 天前
VS Code 安装微信小程序 MCP 介绍
vscode·微信小程序·小程序·mcp
YZJenny4 天前
在服务器上安装使用code-server(Web 版 VS Code)
ide·vscode·编辑器
salestina5 天前
vscode迁移扩展目录
ide·vscode·编辑器
sunoo-2295 天前
【Linux 系统编程】学习第七天:线程属性 | 互斥锁 | 死锁 | 信号量 核心知识点 + 踩坑实战
linux·c语言·笔记·vscode·学习