A code style-format tool for Xcode Source Editor Extension.
You can create your own (or team) code style configuration.
Objective-C(only)
- OS X 10.12 or higher
- Xcode 9.x+
- Download
ClangFormatter.app
- Copy and Open
ClangFormatter.app
to/Applications
Folder. - Run it then close it.
OR
curl -SL https://gist.githubusercontent.com/poplax/c0898b6127a5747bcc1316c2a7ede58e/raw/59339589cae4eacf590fc1ca8dc2cb8bafc330c8/Install-xcode-format-tool | sh
Uninstall
Delete ClangFormatter.app
from /Applications
Check System Preferences -> Extensions -> Xocde Source Editor -> ClangFormat
Start(or restart) The Xcode.
Preferences -> Key bindings -> Filter: clangformat
Editor -> ClangFormat -> ObjC-Format
Change options of the _clang-format-objc
file.
Step 1,2 is Optional
- First, Move to your config file(
_clang-format-objc
) Folder.
In Project:
cd ClangFormat/style-config/
- Copy the config file to the format app.
cp -f ./_clang-format-objc /Applications/ClangFormatter.app/Contents/PlugIns/ClangFormat.appex/Contents/Resources/_clang-format-objc
-
Modify the config file(
_clang-format-objc
) of the user interface -
Other clang-style config file:
- C/C++
- Java
- JavaScript
- Fork from ClangFormatter
- Swift
- Creating a Source Editor Extension(Apple)
- Create an Xcode Source Editor Extension
- ClangFormat
MIT