#BBUncrustifyPlugin-Xcode
Xcode plugin to format code using Uncrustify or ClangFormat.
- Added ClangFormat.
- Preferences window to easily adjust the settings.
- Opening the formatter configuration in an external editor.
- Create factory configuration files (in the preferences window).
- Option to format when saving.
-
Reorganization of the menu: menu items are now in
Edit > Format Code
. -
Uncrustify configuration: The configuration file must be located in the current directory or any parent directories of the source file. The file is named
.uncrustifyconfig
oruncrustify.cfg
. Uncrustify looks for the configuration in the additional folders:Home Folder
and~/.uncrustify/uncrustify.cfg
. -
Minimum requirement is Xcode 5.0+ on OS X 10.9+.
Xcode 5.0+ on OS X 10.9+.
PS: This fork works with Xcode 3.
- The easiest way to install the plugin is to download the last available release (Click on the green button corresponding to the last version).
- Unzip and copy
UncrustifyPlugin.xcplugin
to~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
. - Relaunch Xcode after the copy.
-
Build the Xcode project. The plug-in will automatically be installed in
~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
. -
Relaunch Xcode.
To uninstall, just remove the plugin from ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
and restart Xcode.
All the commands are in the menu Edit > Format Code
.
-
Use the menu
Format Selected Files
to format the selected items in the project navigator. -
Use the menu
Format Active File
to format the source file actually opened in the editor. -
Use the menu
Format Selected Lines
to format the selected source code (multiple selection is supported). The selection is automatically extended in full lines. If the selection is empty, it uses the line under the cursor. -
Use the menu
Edit Configuration
to edit the formatter configuration in an external editor. -
Use the menu
BBUncrustifyPlugin Preferences
to change the plugin preferences.
When the code is reformated, the modifications are recorded in the undo. So undo reverts the modifications.
The Preferences window contains detailed informations to customize the formatter settings.
You can create keyboard shortcuts for the menu items in the Keyboard Preferences of OS X System Preferences.
Benoît Bourdon (@benoitsan). Thanks to the Contributors!
Additional contributors actually not listed here: Dominik Pich.
BBUncrustifyPlugin is available under the MIT license. See the LICENSE file for more info.