tags: sublime clang format C++
ref:
The installation of Clang-Format under WINDOWS
https://gist.github.com/danielTobon43/51764026f95240bbd03991089f0380a8
LLVM download:
After installation
Install the Clang Format plug -in in Sublime Text Package Control
Then set the plug -in:
Preferences->Package Control: Install Package
Clang Format
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",
}
Preferences->Package Settings->Clang Format->Custom Style-User
, add:{
"Language": "Cpp",
"TabWidth": 4,
"AlignTrailingComments": "true",
"UseTab": "Never",
}
You can copy the default.
Finally, set the shortcut key Key Bindings of the plug -in, use the shortcut key to format the code format
Code formatting and saving configuration file under Linux
APT-get install clong-format-7 (other system versions may be-get install clong-format)
clang-format-7 -i xxx.cpp -style=Google
Save the configuration file:
clang-format -style=Google -dump-config > .clang-format
Configuration file modification
tab size
SortIncludes: false
Load the configuration file for formatting (automatically find the .clang-Format configuration file from the current upper directory):
clang-format-7 -style=file -i xxx.cpp
It’s really annoying to configure it, write an article for your reference. Starting URL: http://szhshp.org Last updated: 2018-03-09 ESLint A well-known plugin for JS code specification checking ...
clang-format is a tool to automatically format C/C++/Objective-C code, so that developers don't need to worry about style issues during code reviews. installation Common commands are as...
The specific adding command can be searched in the URL below https://launchpad.net/ubuntu For example, when installing sublime, you can enter sublime in the search box above, and the following w...
Last time I wrote about the sublime text 3 custom plugin steps, can only be said to play a role in the introduction of jade, does not have much practical function, this time I will combine the needs o...