Artistic Style----开源代码格式化工具
来源:互联网 发布:无经验者淘宝客服面试 编辑:程序博客网 时间:2024/05/05 07:12
不足
Shortly after starting to use this macro on a regular basis, I noticed that I was having problems with copy and paste functionality in MSDev. Basically I could copy something but would not be able to paste it (Ctrl-V stopped working, Shift-Insert stopped working, even pasting from context menus stopped working).
Sometimes I could defeat it by copying from one file, pasting into another (like notepad), copying from there and then pasting into the file I originally wanted to paste into. Needless to say it was frustrating.
This started happening shortly after I switched to Win2K and around the same time I started using the macro. For a while I thought it was Win2K, but I eventually noticed the correspondence between using the MakeCodeNicer macro and the copy paste bug.
In general, it only happens after using the macro on relatively large files (a thousand lines up to several thousand).
So, this is just a heads up to anyone using this macro. It seems like the large amount of text modification it does brings out a bug in VC 6's macro language or clip board functionality. Also, I'm not sure if this happens anywhere but Win2K.
To the author: great work... this is a huge time saver for me!
astyle [options] Source1.cpp Source2.cpp [...]
astyle [options] < Original > Beautified格式化后会把原来的文件后缀加上“orig”。
下面通过例子进行说明:
astyle --options=conf.txt test.cpp
上边的命令通过配置文件conf.txt中的选项来格式化文件test.cpp,为了使得astyle命令能够找到可以采用以下三种方法:
1.把conf.txt文件放到与satyle.exe同一目录下
2.指定conf.txt的绝对路径,例如astyle --options=c://conf.txt test.cpp,如果绝对路径中含有空格,则写为:astyle --options=“c://have two spaces//conf.txt” test.cpp
3.指定环境变量。令环境变量名为USERPROFILE,然后值为options文件的路径。
同理,为了能让astyle找到test.cpp文件,也需要采用上述三种方法之一。
其中conf.txt文件格式最后再说。
可以根据帮助文件中的options选项来对这个文件进行修改。
可以参考http://hi.baidu.com/0x01/blog/item/3111b311d4f5ed7fcb80c4af.html
另外,在http://www.geocities.com/jpattee/astylewin/doc/Options.html有一款专门用于windows的Artistic Style for Windows。可以通过工具--》选项以及设置来设置格式(以动态界面显示设置),然后打开特定文件来格式化。其不足是一次只能格式化一个文件,但是,我们可以使用其配置文件,其配置文件AStyleWin.ini的位置要么在类似C:/Documents and Settings/Administrator/Application Data的目录下,要么与AStyleWin.exe在同一目录下。
# set default parsing to c/cpp files
mode=c
# brackets should be attached to pre-bracket lines
brackets=break
# set 6 spaces per indent
indent=spaces=4
suffix=.pre
indent-switches
indent-classes
indent-cases
indent-namespaces
indent-labels
indent-preprocessor
recursive
indent-namespaces
max-instatement-indent=80
min-conditional-indent=0
break-blocks
pad=oper
unpad=paren
convert-tabs
- Artistic Style----开源代码格式化工具
- Artistic Style----开源代码格式化工具
- C、C++、Java和C#的源代码自动格式化工具:Artistic Style
- 如何在Dev c++里配置Artistic Style格式化工具
- SourceInsight 中集成Artistic Style 格式化代码
- SourceInsight 中集成Artistic Style 格式化代码 .
- Artistic Style, 一个很好用的代码格式化工具,可集成至 Source Insight.
- Dev-C++添加代码格式化(format source code)工具Artistic Style
- Artistic Style使用说明
- Artistic Style使用说明
- Artistic Style Options File
- Artistic Style 2.05.1
- Artistic Style Transfer
- vc++2010代码格式化方法(使用Artistic Style,效果好,使用简单,推荐使用)
- javascript 源代码 格式化 工具
- JavaScript源代码格式化工具
- javascript源代码格式化工具
- CoolFormat源代码格式化工具
- gamebryo---NiEntity
- 详解Linux系统修改环境变量PATH路径的方法
- get load区别
- 《软件自动化测试成功之道》节选10 - 数据库连接配置问题
- Windows Azure Platform收费正式启动(转)
- Artistic Style----开源代码格式化工具
- Global.asax.cs防注入问题
- axure 学习收藏
- 【> 0℃编程<】欢迎广大软件爱好者加入我们的家庭 群QQ:86124112
- Windows Azure平台简介(一):定位与产品结构
- GPRS常用指令
- 巧用AT指令做边界测试
- Android root权限
- Windows Azure平台简介(二):Windows Azure