2017.12.06 source insight 代码格式化

在source insight 中有的时候赋值粘贴文件 会试文件格式乱掉,尤其是大括号之类的 特别烦人,
source insight中挂载Astyle工具 能有效的格式化文件格式。

1、下载Astyle工具

在网站http://astyle.sourceforge.net下载

2、source insight中挂载Astyle工具 (目前使用的是source insight4.0)

a、将下载的软件解压,我是放在D盘根目录下,软件好像对路径有限制,,,,。
b、在SourceInsight菜单栏里,Tools–>Custom Commands界面上选择:Add,在弹出对话框写入 命令名,在run中添加相应的命令。
在run中添加
D:\AStyle\bin\astyle.exe –style=ansi -s4 -S -N -L -m0 -M40 –suffix=none –convert-tabs %f
这里写图片描述

3、在菜单中添加 软件。

在Options–>Menu Assignment界面上选择 添加 在任意菜单下,我是添加到了 Tools下了,,

这里写图片描述

4、使用
点击回车 就好
这里写图片描述