Giter VIP home page Giter VIP logo

clangformatforxcode's Introduction

ClangFormatForXcode

Xcode 5 plugin for clang-format.

Disclaimer: This is a work in progress, use at your own risk.

Installation:

  1. Install clang-format (if you don't have it already)
    1.1 If you have homebrew, use the command brew install llvm35 --HEAD --with-clang. You can replace llvm35 with whatever version that is recent. Note that HEAD only builds are not linked in /usr/local/bin in homebrew thus you will need to create a symlink in your ~/bin directory. You can use the command line: ln -s `brew info llvm35 | grep Cellar | awk '{print $1;}'`/bin/clang-format-3.5 ~/bin/clang-format.
    1.2 Alternatively you can build clang-format from souce. Follow the official documentation to checkout llvm and clang and use the build target clang-format. After building, create a symlink to your ~/bin directory e.g. ln -s path/to/build/bin/clang-format ~/bin/clang-format.
  2. In case you have clang-format installed and decided not to create a symlink in ~/bin, change the path to clang-format in PluginPreferences.m. Right now it defaults to ~/bin/clang-format.
  3. Build the project. This will automatically install the plugin in ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins.
  4. Restart Xcode.

Usage: After successfully installing the plugin, you should see a new Clang Format menu under the Edit menu in Xcode. Simply select the line(s) in your source window and click on Clang Format->Format Selected Text. Alternatively you can use the keyboard shortcut โŒ˜+โ‡ง+X to have the same effect.

Users can select between built-in styles from Clang Format->Format Style menu. Note that the selection is global for all projects.

Status: alpha quality.

clangformatforxcode's People

Contributors

tareqsiraj avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.