Created
March 14, 2014 08:01
-
-
Save Akagi201/9543727 to your computer and use it in GitHub Desktop.
config file for astyle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 指定文件处理模式, C/C++模式, 其他选择还有cs, java (缺省值) | |
--mode=c | |
# java风格缩进 | |
--style=java | |
# 缩进采用4个空格 | |
--indent=spaces=4 | |
# 对于单行的语句增加括号 | |
# Add brackets to unbracketed one line conditional statements | |
# (e.g. 'if', 'for', 'while'). | |
--add-brackets | |
# 强制转换TAB为空格 | |
--convert-tabs | |
# 将preprocessor(#define)这类语句, 如果有多行时前面填充对齐, 是对单语句(多行)进行填充 | |
--indent-preprocessor | |
# Attach a pointer or reference operator (* or &) to either the variable type | |
# (left) or variable name (right), or place it between the type and name. | |
# *,&这类字符靠近类型 | |
#--align-pointer=type | |
# *,&这类字符靠近变量名字, 目前选择这个 | |
--align-pointer=name | |
# 在操作符号两边增加空格字符 == | |
--pad-oper | |
# 在几个关键字后面增加空格 | |
# insert space padding after paren headers only (e.g. 'if', 'for', 'while'...). | |
--pad-header | |
# 在if, for, while等代码段前后增加空行, 这个其实挺好, 但如果你不喜欢, 可以关闭 | |
# Pad empty lines around header blocks (e.g. 'if', 'for', 'while'...). | |
--break-blocks | |
# 去掉括号两边多余的空格, | |
# 暂时放弃, 不是特别喜欢这个 | |
# Remove extra space padding around parenthesis on the inside and outside. | |
#--unpad-paren | |
# 备份文件的后缀, 默认是.orig,=none表示不进行备份, | |
# 放弃备份文件, 以Astyle的版本, 目前做这个没有什么差别. 而且备份文件会影响你的代码 | |
--suffix=none | |
# 行结束用什么文件格式, UNIX的还是Windows的, | |
#--lineend=windows | |
# 后台开放统一用UNIX的方式 | |
--lineend=linux | |
# switch case的代码也按照标准缩进方式缩进 | |
--indent-switches | |
# 如果函数开始后面({后面)第一行是注释, 也进行缩进 | |
--indent-col1-comments | |
# 多行条件语句如何进行缩进, =0表示和(对齐, =1表示缩进一次, =2表示缩进两次, =3缩进一个半 | |
# MS visual studio的默认格式化是缩进一个. | |
--min-conditional-indent=1 | |
# 最大缩进对齐长度, 默认40, 最大120, 超过这个长度的多行()内语句不进行缩进, 考虑到现在语句都较长 | |
--max-instatement-indent=80 | |
# ref: http://blog.csdn.net/janepen/article/details/7022180 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://www.gaccob.com/?p=462