I\'d like to format my code using clang-format in CLion. I\'ve gone through the settings and haven\'t found any setting that would allow me to run an external command to tra
The lates version of CLion 2019.1 has native support for ClangFormat.
For previous version go to File->Preferences->Plugins
and search for ClangFormatIJ
. Install this plugin.
It installs the context menu to invoke locally installed clang-format
for a file or for a selection. It also set up the key shortcut for 'Reformat current Statement with clang-format' action.
This option works quite well for me in CLion 218.3 however, it might be included in an early version as well.