READMEClang-Format is a tool to format C/C++/Java/JavaScript/Objective-C/Objective-C++/Protobuf code. It can be configured with a config file within the working folder or a parent folder. Configuration see: http://clang.llvm.org/docs/ClangFormatStyleOptions.html UsageThis extension allows clang-format (version 3.8 or higher) to be used to format C/C++, Javascript etc. source files directly from within Visual Studio Code. Files can be formatted on-demand by right clicking in the document and selecting "Format Document", or by using the associated keyboard shortcut (usually Ctrl+⇧+F on Windows, Ctrl+⇧+I on Linux, and ⇧+⌥+F on macOS). To automatically format a file on save, add the following to your vscode settings.json file:
Specifying the location of clang-formatThis extension will attempt to find clang-format on your
Placeholders can also be used in the
Some examples:
Source codeAvailable on github: https://github.com/xaverh/vscode-clang-format-provider |