Transferred from: http://www.cnblogs.com/xuxm2007/archive/2013/04/06/3002390.html
Well, I have code format of obsessive-compulsive disorder, code is not neat, I see all headache, before always like to use Sourcestyler C + +, but this in Win7 seemingly can not use, can only turn to Astyle.
Http://www.cnblogs.com/xuxm2007/archive/2010/09/21/1832686.html
About the parameters, but not enough on the line, do not have to adjust so fine, more important is to see the code ah, not this thing
The following URLs are also worth referring to:
Http://www.cppblog.com/jerryma/archive/2012/02/02/164813.html
Http://astyle.sourceforge.net/astyle.html
Http://www.cnblogs.com/redspider110/archive/2012/06/22/2558563.html
One, Astyle download path
Astyle is an open source project that supports the code formatting of C + + and Java
Home page:http://astyle.sourceforge.net/
Project page:http://sourceforge.net/projects/astyle/
Download the latest version of Windows Astyle, unzip to the C packing directory
Second, the Source Insight installation Astyle Tools
For example: Add astyle_c command, format C + + file
1. Open a project in source insight and select the Options--custom commands command
2. Tap Add to add a new command Astyle_c.
where you enter command parameters for Astyle in run: C:\AStyle\bin\AStyle.exe--style=linux-s4-s-n-l-m0-m40--pad-oper--suffix=none-- Convert-tabs%f
Self-tested:
"D:\Program files\astyle\bin\astyle.exe"--style=ansi-s4-c-s-n-l-w-y-p-H-K3-W3-M0-M40-- Suffix=none%f
3. Add menu, click "Menu", select Menu--view, then insert.
4. Add the shortcut key, click "Assigh New Key", enter the shortcut key: Ctrl+alt+c. In the future, you can use the shortcut keys by formatting C + + files.
Integrating Astyle in Source insight