AStyle下载链接:https://sourceforge.net/projects/astyle/files/
一些关于指令的博客:https://www.cnblogs.com/gvlthu23061/p/7315998.html
我现在使用的MDK软件:
1.在工具设置中选择Customize Tool Menu
2. 创建一个新的Menu Content,名字为All file
3.在下面的Command指向AStyle.exe ,如 D:\Keil_vM522\AStyle\bin\AStyle.exe
4.在Argument中添加指令 ,我添加的是
"$E*.c" "$E*.h" --add-brackets --align-pointer=name --indent-preprocessor --indent-switches --indent-col1-comments --style=ansi -P -p -n -s4 -S -N -L
具体意思,就自己去找官方的文档查看
5.创建一个新的Menu Content,名字为One file
6.在下面的Command指向AStyle.exe ,如 D:\Keil_vM522\AStyle\bin\AStyle.exe
7.在Argument中添加指令 ,我添加的是
!E --add-brackets --align-pointer=name --indent-preprocessor --indent-switches --indent-col1-comments --style=ansi -P -p -n -s4 -S -N -L
具体意思,就自己去找官方的文档查看