Format code with AStyle
You need to install AStyle
If you on *.debian systems, try
sudo apt install astyle
But remember, in repository may have older version!
The best way - build app using cmake
Common way to build using cmake
mkdir build
cd build
cmake ..
make
sudo make install
- Download source from sourceforge
- Extract archive
- Put
bin/AStyle.exe
into your bin path or add current folder path to your envPATH
- In settings set where is astyle ->
AStyle.exe
(it means that you add folder bin intoPATH
and this contains program namedAStyle.exe
) - Put
astylerc
file with astyle options into%APPDATA%\astylerc
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:
astyleFormat.show-message
: Show message when formatting. By default is trueastyleFormat.astylerc
: Where is file .astylerc. By default is null (it means that file .astylerc exist in your HOME folder)astyleFormat.messageTimeout
: Delay for hide message about formatting
-
All
- Need to check for .astylerc file
- If document not exists, format will not be proceed
- Try find astylerc file into current project (in root dir)
-
Windows
- Add set custom astylerc file