Clang-Format 用法详解
format的使用,参考文章
https://xie.infoq.cn/article/cf4eedc3cc2180eda63d1fcef
下载llvm
https://github.com/llvm/llvm-project/releases/tag/llvmorg-18.1.4
下载文件:“LLVM-18.1.4-win64.exe”
改vscode 自动保存。在首选项中,选setting,搜索“format”。
去掉保存后自动修改选型。
如需要自定义格式,使用下列范本。并在文件夹下自建一文件。名称:“.clang-format”。
---
# We'll use defaults from the LLVM style, but with 4 columns indentation.
BasedOnStyle: LLVM
IndentWidth: 4
---
Language: Cpp
# Force pointers to the type for C++.
DerivePointerAlignment: false
PointerAlignment: Left
---
Language: JavaScript
# Use 100 columns for JS.
ColumnLimit: 100
---
Language: Proto
# Don't format .proto files.
DisableFormat: true
---
Language: CSharp
# Use 100 columns for C#.
ColumnLimit: 100
...

浙公网安备 33010602011771号