rosshemsley / SublimeClangFormat

A C++ code formatter based on Clang Format, for beautiful code with minimal effort in Sublime Text 3
Other
185 stars 52 forks source link

Clang Format

Package Control

What it does

Clang-format is a tool for formatting C++, built on LLVM. This is a package that allows you to run it easily from within Sublime Text.

demo

About

In this package, we provide an alternative wrapper around clang-format for use within Sublime Text 3. Whilst LLVM does provide a very simple plugin to work with Sublime Text here, it doesn't really exploit any of the Sublime Text package functionality. We add new features such as customising the style from a settings file, selecting styles using the Command Palette, and easier installation.

Installing

Use

{
  "folders": [],
  "settings": {
    "ClangFormat": {
      "format_on_save": true
    }
  }
}

If You Liked This

Credits

Thanks to the LLVM project for doing the hard work, including writing clang format, and also the original Sublime Text plugin on which this package is based.

Also thanks to y0ssar1an, Bendtherules and other contributors for their improvements!

Finally

Why not go and watch the video that got me interested in clang-format in the first place?

The Care and Feeding of C++'s Dragons