Thanks Brian! This is great!


On Mar 4, 2015, at 7:26 AM, Brian Gerstle <bgerstle@wikimedia.org> wrote:

Now that the iOS app is using uncrustify to standardize code formatting, we recommend that you setup the BBUncrustify Xcode plugin to reformat your code instead of using Xcode's default Re-indent functionality.  

Optional: if you want to re-map Ctrl-I (default re-indent hotkey) to use uncrustify, you should first remove the default mapping in Xcode:
  1. In Xcode, go to "Preferences" and click the "Key Bindings" tab
  2. Search for "indent" and remove the key binding for Ctrl-I
<image.png>

Now add an application keyboard shortcut for Xcode:
  1. Open the System Preferences > Keyboard > Shortcuts > App Shortcuts > Click +
  2. Set the application to be Xcode
  3. Set the menu title to an action title, e.g. "Format Selected Lines"
  4. Set your shortcut, e.g. Ctrl-I
<image.png>

Happy code linting!

Brian

P.S.
You can also use this approach to set shortcuts for any other functionality!  You might want to run "scripts/setup_git_hooks.sh" to install the uncrustify pre-commit hook.

--
EN Wikipedia user page: https://en.wikipedia.org/wiki/User:Brian.gerstle
IRC: bgerstle
_______________________________________________
Mobile-l mailing list
Mobile-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mobile-l