XEP
https://code.google.com/p/xcode-extend-plug-in/downloads/list
下载 XEP-v1.1.1-beta.pkg
底层使用的是uncrustify
fjh-mac-pro:Resources fengjianhua$ which uncrustify
/opt/local/bin/uncrustify
安装uncrustify
fjh-mac-pro:Resources fengjianhua$ sudo port list uncrustify
Password:
uncrustify @0.60 devel/uncrustify
fjh-mac-pro:Resources fengjianhua$
fjh-mac-pro:Resources fengjianhua$ sudo port install uncrustify
如果你使用的是brew
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" brew install uncrustify
双击安装 XEP-v1.1.1-beta.pkg
后重启xcode
效果如图
可以
格式化 ctrl+shift+f
注释 ctrl + shift +j
块注释 ctrl + shift +cmd +j
copy行向上 ctrl + alt + 向上箭头
copy行向下 ctrl + alt + 向下箭头
删除行 cmd + -
红框要和
which uncrustify
/opt/local/bin/uncrustify 一样
点保存,就可使用了
如果想修改格式化的形式,修改 uncrustify.cfg
~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XEP.xcplugin/Contents/Resources
到uncrustify官网看
uncrustify.sourceforge.net/default.cfg