mprobst / ClangFormatIJ

clang-format for IntelliJ based IDEs
Apache License 2.0
15 stars 9 forks source link

Enhancement: configuration with intelliJ documentation #7

Closed gregbown closed 5 years ago

gregbown commented 6 years ago

Configuration with IntelliJ is not documented very well.

This is what I have found to work with system Windows 10, Webstorm 2018.1.2, NodeJS 8.11.1, npm 6.0.0

Perform an npm install of clang-format global, or inside a project if preffered. npm install clang-format -g

Install IntelliJ/Webstorm plugin ClangFormatIJ File -> Settings -> Plugins -> Browse repositories -> search clang format

Then configure in your IntelliJ/Webstorm File -> Settings -> Tools -> clang-format clang format binary -> Point it to the binary installed by npm C:\Users\Your User Name\AppData\Roaming\npm\node_modules\clang-format\bin\win32\clang-format.exe

If you have a project specific .clang-format file paste the absolute path into PATH in settings Also, you can right click on your local .clang-format file -> Associate with file type -> YAML The clang-format options are documented here There is also an interactive clang-format tool here

Aifeng1214 commented 5 years ago

@gregbown Thanks a lot for your enhancement. But how can I trigger the format when I want to ? Maybe ctrl+alt+L will do the format but it did work.

mprobst commented 5 years ago

@gregbown care to send a PR for the README.md here?