Skip to content

Commit

Permalink
Adds README.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
Krunoslav Zaher authored and Krunoslav Zaher committed Oct 21, 2014
1 parent a239278 commit 6eae4f6
Show file tree
Hide file tree
Showing 12 changed files with 190 additions and 296 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store

*.xcodeproj/xcuserdata/
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
RegX
====

Prettify plugin for Xcode. It enables alignment of specific source code elements and makes code easier to read and understand.

![How does it work](/../content/images/demo.gif?raw=true "How does it work?")

# Installation

1. `$ git clone [email protected]:kzaher/RegX.git`
2. Build in Xcode. (building will automagically install it)
3. Restart Xcode and that should be it.

If it doesn't work, please check messages in console (`Console.app`) while starting Xcode and look for error messages. There is a possibility that you have Xcode version whose DVTPlugInCompatibilityUUID hasn't been specified in Info.plist. To resolve the issue, add your DVTPlugInCompatibilityUUID to Info.plist

# How does it work?

RegX uses regular expressions to group text in columns and align those columns.
Every regular expression group creates one vertically aligned column.
Additional settings for columns can be specified.

# Customization

All of the regular expressions and settings for them are defined in a file called 'Configuration.swift'.

e.g.

```swift
static let assignments = "^" +
" (?# lvalue GROUP)" +
" ([^=]*)" +
" (?# = GROUP)" +
" (\\=) " +
" (?# expression GROUP)" +
" ((?:[^/] | (?:/(?!/)) )*)" +
" (?# comments GROUP)" +
" (//.*)?" +
"$"
```

```swift
RegularForm(name: "Assignments", // name in Edit -> RegX menu
pattern: Patterns.assignments, // grouping regular expression
shortcut: String(UnicodeScalar(NSF4FunctionKey)), // shortcut key
modifier: NSEventModifierFlags.CommandKeyMask, // shortcut modifier
settings: [ // each setting controls start and end padding
GroupSettings(nil, 0), // nil means keep existing padding
GroupSettings(1, 1), // value means ensure padding
GroupSettings(0, 0),
GroupSettings(1, 0),
]
)
```
4 changes: 4 additions & 0 deletions RegX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
C8130E3419F3F01600A13EFB /* Functional.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8130E3319F3F01600A13EFB /* Functional.swift */; };
C8130E3519F3F91500A13EFB /* Functional.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8130E3319F3F01600A13EFB /* Functional.swift */; };
C85B2D5719F5AC8000EB8482 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = C85B2D5619F5AC8000EB8482 /* README.md */; };
C86692A319F1D2FC00582722 /* RegXPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = C86692A219F1D2FC00582722 /* RegXPlugin.swift */; };
C86692B619F1D41300582722 /* TestAlign.swift in Sources */ = {isa = PBXBuildFile; fileRef = C86692B219F1D41300582722 /* TestAlign.swift */; };
C86692B919F1D44100582722 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C86692B819F1D44100582722 /* Info.plist */; };
Expand Down Expand Up @@ -37,6 +38,7 @@
C8130E3319F3F01600A13EFB /* Functional.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Functional.swift; sourceTree = "<group>"; };
C84DFF0D19EE775100C64E17 /* RegX.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RegX.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; };
C84DFF1119EE775100C64E17 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C85B2D5619F5AC8000EB8482 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
C86692A219F1D2FC00582722 /* RegXPlugin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RegXPlugin.swift; sourceTree = "<group>"; };
C86692A819F1D3EA00582722 /* UnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
C86692B219F1D41300582722 /* TestAlign.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestAlign.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -88,6 +90,7 @@
C86692A919F1D3EA00582722 /* UnitTests */,
C84DFF0E19EE775100C64E17 /* Products */,
C8E8F8C819F25FB100101518 /* Frameworks */,
C85B2D5619F5AC8000EB8482 /* README.md */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -254,6 +257,7 @@
files = (
C8D7D1B519F2995700483BFA /* RegularForm.swift in Sources */,
C86692A319F1D2FC00582722 /* RegXPlugin.swift in Sources */,
C85B2D5719F5AC8000EB8482 /* README.md in Sources */,
C8E8F8D719F26A0500101518 /* RegXLogging.swift in Sources */,
C8DCC42319F40E56005B4648 /* Configuration.swift in Sources */,
C8E8F8E319F276B100101518 /* XCodeInternals.m in Sources */,
Expand Down
41 changes: 41 additions & 0 deletions RegX.xcodeproj/project.xcworkspace/xcshareddata/RegX.xccheckout
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>060DE94D-D5C5-47B8-8179-619A12262790</string>
<key>IDESourceControlProjectName</key>
<string>RegX</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>B6952A2EA6A26CAA10AE5DDD2DF1734B7CAED591</key>
<string>github.com:kzaher/RegX.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>RegX.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>B6952A2EA6A26CAA10AE5DDD2DF1734B7CAED591</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>github.com:kzaher/RegX.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>B6952A2EA6A26CAA10AE5DDD2DF1734B7CAED591</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>B6952A2EA6A26CAA10AE5DDD2DF1734B7CAED591</string>
<key>IDESourceControlWCCName</key>
<string>RegX</string>
</dict>
</array>
</dict>
</plist>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6eae4f6

Please sign in to comment.