使用js_beautify统一团队代码风格

介绍

js_beautifyEinar Lielmanis开发的在线javascript代码格式化工具。Einar在github上开源了这个项目的代码,并加入了格式化html代码的支持。

项目地址:http://github.com/einars/js-beautify

在Aptana中使用

1.下载beautify_js_html.js这个文件
2.使用文本编辑器打开,全选,复制
3.打开Aptana,在菜单中选择Scripts->Paste new script
4.用Aptana打开js或html文件,选择菜单Scripts->Javascript->beautify_js_html运行格式化
默认绑定的快捷键是Alt+B,需要修改其他快捷键请修改beautify_js_html.js文件
更多关于在Aptana中使用Eclipse monkey脚本的信息请参考:
http://forums.aptana.com/viewtopic.php?t=5216
http://docs.aptana.com/docs/index.php/About_Eclipse_Monkey
http://docs.aptana.com/docs/index.php/Adding_metadata_to_an_Eclipse_Monkey_script

posted @ 2011-04-22 14:15  wkylin  阅读(7627)  评论(0编辑  收藏  举报