工具 | 版本号 | 下载地址 |
Source Insight | 4.0 | https://download.csdn.net/download/wza1314258/10187367 |
Astyle | http://sourceforge.net/projects/astyle/ |
1. 自定义命令配置
- 下载上方 SourceInsight 和 Astyle 工具;
- Tools -> Custom Commands;
- Add 一个自定义命令 : Astyle;
- 通过 Browser 找到 Astyle.exe 的路径;
- 配置 Astyle.exe 启动参数 : --style=ansi -s4 -S -N -L -m0 -M40 --convert-tabs --suffix=.pre %f
- 我的配置为 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
- 配置参数可参考 :
- https://blog.csdn.net/jackyard/article/details/19615929 (感谢 BeanHuo)
- https://www.cnblogs.com/shangdawei/archive/2013/04/12/3016346.html (感谢 EveryThing)
2. 快捷键设置
- Option -> Key Assignments;
- 通过 Command 窗口查询出新增的 Astyle 指令;
- 点击 Assign New Key... 后,直接在键盘上按出自己喜欢的组合键即可;