This tutorial takes you through the steps of setting up clang-formater in your own sublime text 3 software on Windows 10.
These instructions will get you a full clang format to automatically format C/C++/Objective-C code, so that developers don't need to worry about style issues during code reviews. It is highly recommended to format your changed C++ code before opening pull requests, which will save you and the reviewers' time.copy of the project up and running on your local machine for development and testing purposes. This tutorial will take you trough the full installation on a Windows 10.
What things you need to install.
- Go to
Preferences->Package Control: Install Package
- Install
Clang Format
- Go to
Preferences->Package Settings->Clang Format->Setting-User
, set as following:
{
"binary": "C:/Program Files/LLVM/bin/clang-format.exe",
"format_on_save": true,
"style": "Custom",
}
- Go to
Preferences->Package Settings->Clang Format->Custom Style-User
, add:
{
"Language": "Cpp",
"TabWidth": 4,
"AlignTrailingComments": "true",
"UseTab": "Never",
}
- Save and restart sublime text
- Go to any script page, save it and see the difference