vimrc
vimrc copied to clipboard
g=格式化后缩进是两格,clang-format的IndentWidth选项已经是4,怎么改?
在项目目录下创建.clang-format文件,或者修改用户主目录下的~/.clang-format:
❯ cat ~/.clang-format
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: LLVM
Standard: c++20
IndentWidth: 4
AccessModifierOffset: -4
ColumnLimit: 80
DeriveLineEnding: false
UseCRLF: false
LineEnding: LF
InsertNewlineAtEOF: true
UseTab: Never
TabWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
IndentCaseLabels: false
IndentCaseBlocks: false
IndentRequiresClause: true
RequiresExpressionIndentation: OuterScope
把IndentWidth和TabWidth改成8就行了。