Skip to content

Instantly share code, notes, and snippets.

@dev4dev
Last active March 4, 2016 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dev4dev/9b05eb36ec37f9eb5f50 to your computer and use it in GitHub Desktop.
Save dev4dev/9b05eb36ec37f9eb5f50 to your computer and use it in GitHub Desktop.
ClangFormat

Clang Formatter

  1. Install Alcatraz
  2. Install ClangFormat Plugin ClangFormat
  3. Restart Xcode
  4. Download .clang-format.yml to your home directory
  curl -L -o ~/.clang-format https://gist.githubusercontent.com/dev4dev/78d0508304558e969b2a/raw/9bab5aefe2e29f4b7b6a5560642618e1e78b397c/.clang-format.yml
  1. In Xcode select menu Edit -> Clang Format -> File to use rules from downloaded .clang-format file
  2. Use menu items Edit -> Clang Format -> Format * to format code
  3. (Optional) If you are a lazy ass, you can select Edit -> Clang Format -> Enable Format on Save, thus code will be formatted right before saving to a file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment