Source Insight 代码格式化设置

工具 版本号 下载地址
Source Insight 4.0 https://download.csdn.net/download/wza1314258/10187367
Astyle   http://sourceforge.net/projects/astyle/

 

 

 

 

1. 自定义命令配置

  1. 下载上方 SourceInsight 和 Astyle 工具;
  2.  Tools -> Custom Commands;
  3. Add 一个自定义命令 : Astyle;
  4. 通过 Browser 找到  Astyle.exe 的路径;
  5. 配置 Astyle.exe 启动参数 :  --style=ansi -s4 -S -N -L -m0 -M40 --convert-tabs --suffix=.pre %f 
  6. 我的配置为 Run: "D:\Program Files (x86)\Source Insight 4.0\plugs\AStyle_3.1_windows\AStyle\bin\AStyle.exe"  --style=ansi -s4 -S -N -L -m0 -M40 --convert-tabs --suffix=.pre %f
  7. 配置参数可参考 :

                                    

     

 

2. 快捷键设置

  1. Option -> Key Assignments;
  2. 通过 Command 窗口查询出新增的 Astyle 指令;
  3. 点击 Assign New Key... 后,直接在键盘上按出自己喜欢的组合键即可;