Astyle-3.1格式化代码

  • --options="C:\Program Files (x86)\Dev-Cpp\AStyle\Astyle.cfg"
  • -A1 -xV -S -xt1 -xW -w -xw -Y -m0 -M120 -f -p -H -U -k1 -y -xb -j -xf -xh -c -xC80 --mode=c -n
  • Dev-C++:-A1 -xV -S -xt1 -xW -w -xw -Y -m0 -M120 -f -p -H -U -k1 -y -xb -j -xf -xh -c -xC80 --mode=c -n
  • Source Insight:"C:\Program Files (x86)\Dev-Cpp\AStyle\AStyle.exe" -A1 -xV -S -xt1 -xW -w -xw -Y -m0 -M120 -f -p -H -U -k1 -y -xb -j -xf -xh -c -xC80 --mode=c -n %f
  • mdk:
    1. 单文件:-A1 -xV -S -xt1 -xW -w -xw -Y -m0 -M120 -f -p -H -U -k1 -y -xb -j -xf -xh -c -xC80 --mode=c -n !E
    2. 目录下所有文件:-A1 -xV -S -xt1 -xW -w -xw -Y -m0 -M120 -f -p -H -U -k1 -y -xb -j -xf -xh -c -xC80 --mode=c -n "$E*.c" "$E*.h"

工具下载链接

# "C:\Program Files (x86)\Dev-Cpp\AStyle\AStyle.exe" -A1 -xV -S -xt1 -xW -w -xw -Y -m0 -M120 -f -p -H -U -k1 -y -xb -j -xf -xh -c -xC80 --mode=c -n %f
-A1 
-xV # Attach the closing 'while' of a 'do-while' statement to the closing brace.
-S # Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block. The entire case block is indented.
-xW # Indent preprocessor blocks at brace level zero and immediately within a namespace. 
-w 
-xw # Indent preprocessor conditional statements to the same level as the source code.
-Y # This option will allow the comments to be indented with the code.
-m0 
-M120 
-f # Pad empty lines around header blocks (e.g. 'if', 'for', 'while'...).
-p # Insert space padding around operators. This will also pad commas.
-H # Insert space padding between a header (e.g. 'if', 'for', 'while'...) and the following paren. 
-U 
-k3 
-xb # Break one line headers (e.g. 'if', 'while', 'else', ...) from a statement residing on the same line.
-j # Add braces to unbraced one line conditional statements (e.g. 'if', 'for', 'while'...). 
-xf 
-xh 
-c 
-n
-xe
-L # Add extra indentation to labels so they appear 1 indent less than the current indentation, rather than being flushed to the left (the default).
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值