XAlign 是一個 Xcode 的實用插件永部,用于對齊規(guī)范代碼捐祠。除了插件作者 qfish 提供的 3 種對齊格式眶熬,還可以自定義任意你想要的格式蒙秒。
示例
qfish 分享的 3 張示例圖( Gif )勃黍,如下:
1. 按首個 = 對齊
2. 按宏定義群組對齊
3. 按屬性群組對齊
安裝
1. 自動安裝
1
$ curl github.so/XAlign/build/install.sh | sh
2. 手工安裝
下載 XAlign.tar.gz
然后解壓,把 XAlign.xcplugin 復(fù)制或移動到下面這個目錄:
~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/
小貼士:用 cmd+shift+g 快速查找晕讲;如果沒有 Plug-ins 目錄覆获,你得創(chuàng)建一個
然后重啟 Xcode
卸載
1
$ curl github.so/XAlign/build/uninstall.sh | sh
使用方法
開啟
1
Xcode -> Edit -> XAlign
自動對齊快捷鍵
1
shfit + cmd + x
開源地址:https://github.com/qfish/XAlign