a great tool for automatically formating your code!
3158 단어 format
vim .clang-format
IndentWidth: 8
UseTab: Always
BreakBeforeBraces: Linux
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
2. Then use the clang-format plug-in to automatically format your code.
Edit-->Clang-format-->Format File in Focus
Most likely, you'll have a .clang-format file at the root of your project.
So easy! so neat!
ClangFormat-Xcode
An Xcode plug-in to format your code using Clang's format tools, by @travisjeffery .
With clang-format you can use Clang to format your code to styles such as LLVM, Google, Chromium, Mozilla, WebKit, or your own configuration.
Installation:
Install via Alcatraz .
OR
Clone this repo, build and run ClangFormat, restart Xcode.
Usage:
Format on save
I.e., you press
command-s
and the file is formatted and wrote to disk. In the menu, open Edit > Clang Format > Click Format on save (a checkmark appears in this menu item indicicating that the feature is active.)
Assign keyboard shortcuts
You can assign your own keyboard shortcuts like so:
In this example, we'll format the active file when
control-i
is pressed. Using your own style configuration
By using Clang Format > File in the plug-in menu, Clang will look for the nearest
.clang-format
file from the input file. Most likely, you'll have a .clang-format file at the root of your project. Here are the options for .clang-format and how they're configured .
If one of the built-in styles is close to what you want, you can bootstrap your own configuration with:
./bin/clang-format -style=llvm -dump-config > .clang-format
For example, this .clang-format is similar to the Linux Kernel style :
BasedOnStyle: LLVM
IndentWidth: 8
UseTab: Always
BreakBeforeBraces: Linux
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
And this is similar to Visual Studio's style:
UseTab: Never
IndentWidth: 4
BreakBeforeBraces: Allman
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
ColumnLimit: 0
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
The format-detection attribute and meaning in the Meta tagThe translation of format-detection into Chinese means "format detection". As the name suggests, it is used to detect so...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.