Closed priyanshu219 closed 4 years ago
Looks like these are both questions about clang-format style options and not this vim plugin, correct? I believe you're looking for two of the clang-format tool's style options IndentWidth
and AccessModifierOffset
and you can put those in a .clang-format file in your project, as explained at https://clang.llvm.org/docs/ClangFormatStyleOptions.html.
In general you should try calling clang-format on the command-line and see if it has the same behavior. You can ask about all the specifics of clang-format tool on the mailing lists for LLVM.
I am confusing by the same issue.
I have tried calling from one the command-line. The only difference between calling on the commandline and formatting by vim-codefmt is the single whitespace before public. It disappared when using vim-codefmt.
My ~/.clang-format file content:
BasedOnStyle: Google
Recently I installed plugins:
And activate it using:
Now during formatting using:w(as it automatically calling :FormatCode clang-format), its format using indentation of 2, but I want to customise it to 4.
Secondly, it format class in a different way, for example: Before formatting:-
After formatting:
So can anyone tell me how to fix? Or Is this inbuilt? Currently, I am using ubuntu 20.04 and want to format C++ code