Source Insight的代码格式化配置和使用(动画演示工具-Astyle)

目录

1.Astyle工具 

2.Astyle工具配置

3.格式化参数含义

4.演示效果动画


1.Astyle工具 

         Astyle是一个免费的代码格式化工具,能够格式C/C++/Java等代码。

        下载地址为:https://sourceforge.net/projects/astyle/

         工具主页为:http://astyle.sourceforge.net/

2.Astyle工具配置

  1. 将下载后的AStyle_3.0.1_windows放在Source Insight安装目录下并解压。
  2. 在Source Insight 的菜单栏中,选择 tools->Custom Commands  

        如下图:点击add输入命令名字:astyle(随便起)

          

        3.配置路径和参数

         run: D:\tools\AStyle_3.1_windows\AStyle\bin\AStyle.exe astyle *.c *.cpp *.h --recursive --style=bsd --convert-tabs --indent=spaces=4 --attach-closing-while --indent-switches --indent-namespaces --indent-continuation=4 --indent-preproc-block --indent-preproc-define --indent-preproc-cond --indent-col1-comments --pad-oper --pad-paren-in --unpad-paren --delete-empty-lines --align-pointer=name --align-reference=name --break-elseifs --add-braces

   或者:

        run:D:\tools\AStyle_3.1_windows\AStyle\bin\AStyle.exe --style=ansi -s8 -S -N -L -m0 -M40 --convert-tabs --suffix=.pre %f

          

         4:添加快捷键

         点击下图中的keys

           

         点击下图中的Assign New key  后再键盘输入快捷键 例如ctrl + alt +p

          

          

         5.添加菜单按钮

           点击下方红框里的menu

            

            

         选择menu的work菜单栏  点击astyle insert由灰变黑,点击插入即可 

             

3.格式化参数含义

      https://blog.csdn.net/wisepragma/article/details/80993437

4.演示效果动画

 

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值