indent命令总结

变量声明后加空行  
--blank-lines-after-declarations
-bad
函数结束后加空行  
--blank-lines-after-procedures    
-bap
块注释前加空行    
--blank-lines-before-block-comments
-bbb
在函数,变量声明中,若出现逗号即换行  
--blank-lines-after-commas 
-bc
变量声明中,逗号分隔的变量不分行
--no-blank-lines-after-commas
-nbc    
较长的行,在逻辑运算符前分行
--break-before-boolean-operator
-bbo
"if"(或是else,for)和"{"分做两行, "}"自成一行
--braces-after-if-line
-bl
设置{ }缩排的格数。
--brace-indent<缩排格数>
-bli0
在sizeof之后空一格。
--blank-before-sizeof
-bs
定义结构体时,"struct"和"{"分行
--braces-after-struct-decl-line    
-bls
将注释置于程序码右侧指定的栏位(语句后注释开始于33列)
--comment-indentation    33    
-c33
变量声明后注释开始于行33
--declaration-comment-columnn 33
-cd33
注释符号自成一行
--comment-delimiters-on-blank-lines
-cdb
"else"和其前面的"}"另起一行
--cuddle-else
-ce
"do --- while"的"while"和其前面的"}"另起一行
--cuddle-do-while
-cdw
switch中的case语句缩进0个空格
--case-indentation 0
-cli0
"#else", "#endif"后面的注释开始于行33
--else-endif-columnn 33    
-cp33
在类型转换后面加空格
--space-after-cast
-cs
单行注释,向左缩进的列数
--line-comments-indentation 0    
-d0
叙述过长而换行时,指定换行后缩排的格数
--continuation-indentation <缩排格数>
-ci0
变量声明,变量开始于2行,即不必对齐
--declaration-indentation n
-di0
开启全部格式化注释的开关
--format-all-comments
-fca
非注释行最长75个字符
--line-length 75
-l75
设置缩排的格数, 如果为tab的整数倍,用tab来缩进,否则用空格填充
--indent-level <格数>
-i4
使用tab来缩进
--use-tabs
-ut
一个tab为4个空格(要能整除"-indent-level")
--tab-size 4
-ts4
设置参数的缩排格数。
--parameter-indentation <格数> 
-ip4
针对放在每行最前端的注释,设置其格式
--format-first-column-comments
-fc1
换行从上一行出现的括号开始
--continue-at-parentheses 
-lp
函数和"("之间插入一个空格
--space-after-procedure-calls
-pcs
在"("后")"前插入空格
--space-after-parentheses
-prs
for后面有空格
--space-after-for
-saf
if后面有空格
--space-after-if
-sai
while后面有空格
--space-after-while
-saw
在生成的块注释中加*
--start-left-side-of-comments
-sc
注解左侧不要加上星号(*)
--dont-star-comments
-nsc
删除多余的空白行
--swallow-optional-blank-lines
-sob
一行的for或while语句,在";"前不加空格
--space-special-semicolon
-ss
将函数名和返回类型放在两行定义 
--procnames-start-lines
-psl
函数类型与函数名放在同一行
--dont-break-procedure-type
-npsl 
函数的参数一个一行
--break-function-decl-args
-bfda
不要格式化起于第一行的注释
--dont-format-first-column-comments
-nfc1
不要格式化任何的注释
--dont-format-comments
-nfca
在调用的函数名称之后不要加上空格
--no-space-after-function-call-names
-npcs
不要读取indent的配置文件.indent.pro。
--ignore-profile
-npro
不用处理多余的空白行
--leave-optional-semicolon
-nsob
若for或while区段仅有一行时,在分号前不加上空格
--dont-space-special-semicolon
-nss
在调用的函数名称与"{"之间加上空格
--space-after-procedure-calls
-pcs

已有的风格
使用GNU的格式
--gnu-style 
使用Kernighan&Ritchie的格式
--k-and-r-style
使用Berkeley的格式
--original

猜你喜欢

转载自blog.csdn.net/qq_33882435/article/details/130486768
今日推荐