配置文件
安装
首先安装clang-format
sudo apt install clang-format
配置
执行如下命令,生成Google
风格C++
配置文件:
clang-format -style=google -dump-config > .clang-format
生成得到YAML
格式配置文件.clang-format
修改
修改部分选项,更符合个人需求:
tab
宽度从8
修改为4
#TabWidth: 8
TabWidth: 4
indent
宽度从2
修改为4
#IndentWidth: 2
IndentWidth: 4