Format code with AStyle
You need to install http://astyle.sourceforge.net/ Check install page or, if you on deb system, try
The best way - build app using cmake
How to use
For format document you need to click CTRL+ALT+L combination (just like in IDEA Studio) in opened, and saved document in HDD.
For Mac CMD+ALT+L (i don't have a MacBook...)
This extension contributes the following settings: