Chinaunix首页 | 论坛 | 博客
  • 博客访问: 168490
  • 博文数量: 39
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 214
  • 用 户 组: 普通用户
  • 注册时间: 2014-04-21 11:10
文章分类

全部博文(39)

文章存档

2017年(6)

2016年(1)

2015年(6)

2014年(26)

我的朋友

分类: C/C++

2015-01-15 09:33:54



"D:\AStyle\bin\AStyle.exe" --mode=c --indent=tab --style=ansi -S -N -L -m0 --suffix=.pre %f
在Souce Insight中添加,第一个图是添加命令-> add -> 输入命令名称比如Astyle_Code ,然后点击Keys...进入快捷键设置的页面


下面这张图是给命令添加快捷键,比如Ctrl+Alt+F,


    --mode=c
    Indent a C or C++ source file (this is the default).           默认就是C或者C++,不用刻意指定;

--indent=tab  OR  --indent=tab=#  OR  -t  OR  -t#                缩进使用TAB,或者-t也可以,默认是4个空格对齐
    Indent using tab characters, assuming that each
    indent is # spaces long. Not specifying # will result
    in a default assumption of 4 spaces per indent.

Bracket Style Options:                                                        括号格式
----------------------
    --style=allman  OR  --style=ansi   OR  --style=bsd
                    OR  --style=break  OR  -A1
    Allman style formatting/indenting.
    Broken brackets.

    --style=linux  OR  --style=knf  OR  -A8
    Linux style formatting/indenting.
    Linux brackets, minimum conditional indent is one-half indent.
        ……

Indentation Options:
--------------------
    --indent-classes  OR  -C
    Indent 'class' blocks so that the entire block is indented.


    --indent-modifiers  OR  -xG
    Indent 'class' access modifiers, 'public:', 'protected:' or
    'private:', one half indent. The rest of the class is not
    indented. 

    --indent-switches  OR  -S
    Indent 'switch' blocks, so that the inner 'case XXX:'
    headers are indented in relation to the switch block.

--indent-namespaces  OR  -N
    Indent the contents of namespace blocks.

--indent-labels  OR  -L
    Indent labels so that they appear one indent less than
    the current indentation level, rather than being
    flushed completely to the left (which is the default).


 --suffix=####                                                                        指定备份原始文件的后缀
    Append the suffix #### instead of '.orig' to original filename.


    --suffix=none  OR  -n                                                            也可以不进行备份
    Do not retain a backup of the l file.origina






阅读(1692) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~