This package provides the following services:
formatter-clangformat
Formatter for C, C++, Objective-C, Java, Javascript, and Protobuf.
This Formatter plugin for Formatter provides an interface to clang-format.
Installation
-
Install clang-format (ex: on OSX with brew ->
brew install clang-format
) -
Install Formatter package via Atom
- or with
apm install formatter
- or with
-
Install formatter-clangformat package via Atom
- or with
apm install formatter-clangformat
- or with
Usage
In your source compatible file
Default (inspired from IntelliJ):
'atom-text-editor':
'alt-ctrl-l': 'formatter:format-code'
'alt-cmd-l': 'formatter:format-code'
List of config
-
Path to the exectuable
- Full path clang-format
-
C language
-
Enable formatter for C language (need restart Atom)
-
Arguments passed to the formatter C language
- Example :
-assume-filename=/usr/local/mycfg/c/.clang-format
- Example :
-
-
C++ language
-
Enable formatter for C++ language (need restart Atom)
-
Arguments passed to the formatter C++ language
- Example :
-assume-filename=/usr/local/mycfg/cpp/.clang-format
- Example :
-
-
Objective-c language
-
Enable formatter for Objective-c language (need restart Atom)
-
Arguments passed to the formatter Objective-c language
- Example :
-assume-filename=/usr/local/mycfg/objc/.clang-format
- Example :
-
-
Java language
-
Enable formatter for Java language (need restart Atom)
-
Arguments passed to the formatter Java language
- Example :
-assume-filename=/usr/local/mycfg/java/.clang-format
- Example :
-
-
Javascript language'
-
Enable formatter for Javascript language (need restart Atom)
-
Arguments passed to the formatter Javascript language
- Example :
-assume-filename=/usr/local/mycfg/js/.clang-format
- Example :
-
-
Protobuf language'
-
Enable formatter for Protobuf language (need restart Atom)
-
Arguments passed to the formatter Protobuf language
- Example :
-assume-filename=/usr/local/mycfg/proto/.clang-format
- Example :
-
TODO
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request 😄
License
See LICENSE.md