diff --git a/README.md b/README.md index 6d3ade1..59ae3f3 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -XAlign +XAlign (Ready for Xcode 8+ 🚀) ====== 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. +Here are some example alignment patterns. Of course you can make your own. The pattern file is here: `/Source/Patterns.bundle/default.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]](https://github.com/qfish/XAlign/issues?state=open)**._ :) + * _You may not like the alignment style below, **try it yourself** or **tell me at the [Issues](https://github.com/qfish/XAlign/issues?state=open)**._ :) * 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](https://github.com/qfish/XAlign/issues?state=open)。 @@ -27,74 +27,26 @@ Here are some example alignment patterns. Of course you can make your own. The p - [x] Much easier to customize alignment patterns. -## Install & Update +## Install on Xcode 8 +1. Download the [XAlign.dmg 📎](https://github.com/qfish/XAlign/releases/download/untagged-37425b5c3153fd315072/XAlign.1.0.dmg) +2. Open and copy `XAlign.app` to `/Applications` folder +3. Run it then close it. -### 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 - -```shell -curl -fsSL http://qfi.sh/XAlign/build/install.sh | sh -``` - -### Manually - -1. Download this package [XAlign.tar.gz](http://qfi.sh/XAlign/build/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. +## Usage +### 1. Enable XAlign +Check System Preferences -> Extensions -> Xocde Source Editor -> XAlign -3. Restart Xcode. + ![help-1](https://cloud.githubusercontent.com/assets/679824/20145614/b86f6742-a6db-11e6-846b-771447ec0933.png) -## Uninstall -```shell -curl -fsSL http://qfi.sh/XAlign/build/uninstall.sh | sh -``` +### 2. Setting Shortcut in Xocde +Preferences -> Key bindings -> Filter: xalign -or Delete the following directory: + ![help-2](https://cloud.githubusercontent.com/assets/679824/20146079/735244ca-a6dd-11e6-83a9-069fd489b0f6.png) -``` -~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XAlign.xcplugin -``` +## Trouble Shooting +* Please `run sudo /usr/libexec/xpccachectl` and **restart your Mac** before running the extension if you are on macOS 10.11 El Capitan. +* If you are looking for the version supporting Xcode 7, check this branch; -## Usage -### In Xcode -``` -Xcode -> Edit -> XAlign -``` - -### Auto Align Shortcut (default) -``` -Shift + Cmd + X -``` -You can choose the shortcut in the Settings panel, `Xcode -> Edit -> XAlign -> Setting`. - -## Trouble-Shooting - - * [wiki](https://github.com/qfish/XAlign/wiki) - -### New version Xcode ? Try this in your terminal : - - 1. Get current Xcode UUID - - ```shell - XCODEUUID=`defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID` - ``` - 2. Write it into the Plug-ins's plist - - ```shell - for f in ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/*; do defaults write "$f/Contents/Info" DVTPlugInCompatibilityUUIDs -array-add $XCODEUUID; done - ``` - 3. Restart your Xcode, and select Load Bundles on the alert - ## Want to help * [Star this repository](https://github.com/qfish/XAlign/) @@ -103,7 +55,7 @@ You can choose the shortcut in the Settings panel, `Xcode -> Edit -> XAlign -> S ## Special thanks to -* [![Geek-Zoo](http://geek-zoo.com/img/images/logo_2.png)](http://www.geek-zoo.com) +* Geek Zoo Studio Geek Zoo Studio They provide awesome design and development works continues to help the open-source community even better. @@ -111,4 +63,3 @@ You can choose the shortcut in the Settings panel, `Xcode -> Edit -> XAlign -> S * [BeeFramework](https://github.com/gavinkwoe/BeeFramework) BeeFramework is a new generation of development framework which makes faster and easier app development, Build your app by geek's way. - diff --git a/XAlign.xcodeproj/project.pbxproj b/XAlign.xcodeproj/project.pbxproj index d20cfae..ef476a7 100644 --- a/XAlign.xcodeproj/project.pbxproj +++ b/XAlign.xcodeproj/project.pbxproj @@ -19,7 +19,6 @@ E93E2AC21DCB914400F7BEA4 /* NSString+XAlign.m in Sources */ = {isa = PBXBuildFile; fileRef = E93E2ABF1DCB914400F7BEA4 /* NSString+XAlign.m */; }; E93E2AC31DCB914400F7BEA4 /* XAlignPattern.m in Sources */ = {isa = PBXBuildFile; fileRef = E93E2AC11DCB914400F7BEA4 /* XAlignPattern.m */; }; E93E2AC51DCB93FA00F7BEA4 /* Patterns.bundle in Resources */ = {isa = PBXBuildFile; fileRef = E93E2AC41DCB93FA00F7BEA4 /* Patterns.bundle */; }; - E93E2AC61DCB93FA00F7BEA4 /* Patterns.bundle in Resources */ = {isa = PBXBuildFile; fileRef = E93E2AC41DCB93FA00F7BEA4 /* Patterns.bundle */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -268,7 +267,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - E93E2AC61DCB93FA00F7BEA4 /* Patterns.bundle in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/XAlign/Base.lproj/Main.storyboard b/XAlign/Base.lproj/Main.storyboard index 826c2b8..e9ae21f 100644 --- a/XAlign/Base.lproj/Main.storyboard +++ b/XAlign/Base.lproj/Main.storyboard @@ -1,7 +1,8 @@ - - + + - + + @@ -653,7 +654,7 @@ - + @@ -665,7 +666,7 @@ - + @@ -674,20 +675,31 @@ - + - + - + + + + + + + + + + + + - +