KEIL MDK AStyle 格式化代码

 

添加AStyle进行代码格式化

(1)下载AStyle:

https://sourceforge.net/projects/astyle/files/astyle/,将Astyle.exe放置keil安装路径下。

(2)在keil中设置:

KEIL MDK AStyle 格式化代码  KEIL MDK AStyle 格式化代码

    2.1【Command】填写下载的Astyle.exe放置的路径

如放在keil的安装路径下:D:\software\keil\AStyle.exe

    2.2【Arguments】设置参数示例

!E --style=allman --indent=spaces=4 --indent-preproc-block --pad-oper --pad-header --unpad-paren --suffix=none --align-pointer=name  --convert-tabs --verbose

(3)使用:

点击 tools ---  current,即可 格式化 当前文件代码。

KEIL MDK AStyle 格式化代码

附:

设置显示tab键与空格键

KEIL MDK AStyle 格式化代码

 KEIL MDK AStyle 格式化代码