Source Insight 格式化

1、Artistic Style 下载地址:http://sourceforge.net/project/showfiles.php?group_id=2319l

2、在Source Insight挂载AStyle

2.1解压到某个目录(记住路径,如D:\AStyle\)

2.2SourceInsight -> Options -> Custom Commands -> Add 在弹出的对话框中写入命令名(最终会出现在View下面)

2.3在Run中添加相应命令:D:\AStyle\bin\AStyle.exe --style=ansi -s4 -S -N -L -m0 -M40 --convert-tabs --suffix=.pre %f

即,ansi C 格式化当前文件!

如果要格式化某个目录下所有文件:

在Run中添加命令为:D:\AStyle\bin\AStyle.exe Z:\Android/*.c Z:Android/*.h --style=ansi -s4 -S -N -L -m0 -M40 --recursive --convert-tabs --suffix=.pre %f

2.4Dir留空,将Iconic Window, Capture Output, Parse Links in OutPut, File,then Line 四项前打上勾。

2.5然后点对话框中右侧的按钮“Menu”, Menu--->Menu-->View--><end of menu>, 右侧Insert, OK.

2.6此时在SourceInsight中的View菜单下多了个Style的子菜单选项,可以用它来对单个C/C++文件进行格式化。

 

参考:

http://blog.csdn.net/lb015331/article/details/6817599

http://blog.csdn.net/rishihk/article/details/2297093

转载于:https://www.cnblogs.com/jimwind/archive/2013/05/08/3067724.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值