ClangFormatIJ

Compatible with: IntelliJ IDEA PhpStorm WebStorm PyCharm RubyMine AppCode CLion Gogland DataGrip Rider Android Studio
01.07.2016
3 392

Runs clang-format on the statement or selection.

clang-format is a versatile and beautiful formatter for C++, proto, Java, JavaScript, and TypeScript.

This plugin does not contain clang-format itself, you must install it separately. clang-format is available in e.g. npm, or homebrew for Mac. This plugin also has no configuration, please use the regular .clang-format mechanism.

If you are using Mac OS X and have trouble getting it to run, please make sure to set your PATH environment in $HOME/.profile. Mac OS X seems to ignore $HOME/.bash_profile for applications launched from the Finder.

Download plugin

Recent change notes

  • 1.0.8 - Pass -style=file to clang-format.
  • 1.0.7 - Change the default keybinding to Ctrl/Cmd-Alt-K, which doesn't conflict with known existing bindings.
  • 1.0.6 - Search the PATH for the binary.
  • 1.0.5 - Use a login shell to find PATH on Mac OS, add a config panel.
  • 1.0.4 - Drop crazy PATH logic, recommend $HOME/.profile to users.
  • 1.0.3 - Fix location math, add logic to find binary on MacOS X.
  • 1.0.2 - Use the full file path, so that clang-format picks up the correct configuration file.
  • 1.0.1 - Fix description.
  • 1.0 - Initial version.