码迷,mamicode.com
首页 > 其他好文 > 详细

XAlign—自动对齐代码插件

时间:2015-12-07 18:35:15      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:

XAlign

An amazing Xcode plugin to align regular code. It can align anything by using custom alignment patterns.

What‘s XAlign

Here are some example alignment patterns. Of course you can make your own. The pattern file is here:XAlign/patterns.plist, and the patterns are based on regular expression.

Tips:

  • You may not like the alignment style below, try it yourself or tell me at the [Issues]. :)
  • There is no need to align all codes at a time when they are complicated, try to align by group which the codes are more similar in.
  • 对齐不需要一次全部对齐,可以分组多对几次,那些等号差的太远的就别让它参与对齐了。
  • 默认对齐的风格不是你喜欢的,可以自定义,或者提个 Issues

Align by equals sign

技术分享

Align by define group

技术分享

Align by property group

技术分享

Todo:

  •  Much easier to customize alignment patterns.

Install & Update

Via source

  1. Clone this repo

  2. Then build the XAlign target in the Xcode project and the plug-in will automatically be installed in~/Library/Application Support/Developer/Shared/Xcode/Plug-ins

  3. Restart Xcode.

Via command-line

curl -fsSL http://qfi.sh/XAlign/build/install.sh | sh

Manually

  1. Download this package XAlign.tar.gz
  2. Unpack it, copy or move the XAlign.xcplugin to the following path:

    ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/
    

    Tips: To quickly go to Finder type Shift + Cmd + G. If there is no Plug-ins directory, you should make one.

  3. Restart Xcode.

Uninstall

curl -fsSL http://qfi.sh/XAlign/build/uninstall.sh | sh

or Delete the following directory:

~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XAlign.xcplugin

 

 

使用方法

安装

下载后运行工程

开启

Xcode -> Edit -> XAlign

自动对齐快捷键

shfit + cmd + x

 git地址

https://github.com/qfish/XAlign

 

XAlign—自动对齐代码插件

标签:

原文地址:http://www.cnblogs.com/yidoucai/p/5026626.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!