Asytle+SourceInsight实现代码格式化

目录

1、AStyle.exe下载工具

 2、Source Insight添加指令

3、测试结果


1、AStyle.exe下载工具

 1.1  官网地址:https://sourceforge.net/projects/astyle/files/

 1.2  下载完毕后,取出AStyle.exe文件,将其放到要存放的目录下例如:E:\SoftWord\Source Insight\

 2、Source Insight添加指令

2.1  打开Source Insight,切换到Base工程

2.2  点击右侧Add按钮,添加名称AStyle-Code,勾选Output 和 Control相应选项,点击OK完成。

2.3  在Run命令框里输入 如下命令:

       E:\SoftWord\Source Insight\AStyle.exe --style=allman -k3 -W1 -xG -S -s4 -xb -U -p -xf -xh -xC120 -xL -H -Y -xW -w -n %f 

或者按照如下步骤操作,获取路径后,把上方红色字符串复制到路径后面。

2.4  设置指令

2.5  回到普通工程中操作指令,ctrl+alt+c 出现Unable to execute E:\sihook4.exe问题

3、测试结果

证明运行成功。

猜你喜欢

转载自blog.csdn.net/m0_56769186/article/details/126999765
今日推荐