跳到正文

个人记录

教程:在 vscode 中使用 LOJ 的代码格式化

Anakin_XYLei约 1 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年2月4日
篇幅
约 1 分钟

版本

  1. v1当前

首先安装 clang-format。

由于本人使用 Ubuntu,故直接在终端中输入:

代码
sudo apt install clang-format

并在 vscode 中直接搜索安装 clang-format 插件。

打开 vscode 设置的 .json 文件,添加以下一行:

代码
"clang-format.style": "{BasedOnStyle: Google, IndentWidth: 4, AccessModifierOffset: -4, SortIncludes: false, AllowShortIfStatementsOnASingleLine: false, ColumnLimit: 110, Cpp11BracedListStyle: false }"

配置完成。

原文