您可以使用C_Cpp.clang_format_fallbackStyle 中的C_Cpp.clang_format_fallbackStyle 中的ColumnLimit 成员轻松设置列限制@ 987654323@(您必须安装Microsoft C/C++ 扩展)
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: WebKit, IndentWidth: 4, ColumnLimit: 80 }",
然后您可以使用 Shift + Alt + F
格式化文件
您可以在此格式功能中更改许多选项
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: WebKit, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Attach, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 80, AccessModifierOffset: -4 }",
预定义样式的名称,在 clang-format 的情况下用作后备
使用样式文件调用,但找不到 .clang-format 文件。
可能的值为 Visual Studio、LLVM、Google、Chromium、Mozilla、
WebKit, Microsoft, GNU, none, 或使用 {key: value, ...} 设置特定的
参数。例如,Visual Studio 风格类似于:{
BasedOnStyle:LLVM,UseTab:从不,IndentWidth:4,TabWidth:4,
BreakBeforeBraces:奥尔曼,AllowShortIfStatementsOnASingleLine:假,
IndentCaseLabels:假,ColumnLimit:0,AccessModifierOffset:-4,
NamespaceIndentation:全部,FixNamespaceComments:false }
之前
void Proc::Memory::getSramOff(const char* mem_name, uint dataSize, uint addrBits, uint& noOfBytes, uint& sram_off)
之后
void Proc::Memory::getSramOff(const char* mem_name, uint dataSize,
uint addrBits, uint& noOfBytes, uint& sram_off)