-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of http://github.com/mads379/align.tmbundle
Conflicts: Commands/Align Source.tmCommand
- Loading branch information
Showing
8 changed files
with
172 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# standard Hash-literal syntax: | ||
{ | ||
:short => 'bar', | ||
:much_longer => 'baz' | ||
} | ||
|
||
|
||
# should become: | ||
{ | ||
:short => 'bar', | ||
:much_longer => 'baz' | ||
} | ||
|
||
# but 1.9 Hash-literal syntax: | ||
{ | ||
short: 'bar', | ||
much_longer: 'baz' | ||
} | ||
|
||
# should become: | ||
{ | ||
short: 'bar', | ||
much_longer: 'baz' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?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>name</key> | ||
<string>Alignment Patterns (Ruby)</string> | ||
<key>scope</key> | ||
<string>source.ruby</string> | ||
<key>settings</key> | ||
<dict> | ||
<key>shellVariables</key> | ||
<array> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_SOURCE_ALIGNMENT_PATTERN</string> | ||
<key>value</key> | ||
<string>[ | ||
{ | ||
"regexp" : "=>", | ||
"spacing" : "before" | ||
}, | ||
{ | ||
"regexp" : ":", | ||
"spacing" : "after" | ||
}]</string> | ||
</dict> | ||
</array> | ||
</dict> | ||
<key>uuid</key> | ||
<string>014C8ED7-9501-4479-B890-4A15125FF379</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# align.tmbundle | ||
|
||
This is a greatly improved alignment command. Rather than just aligning | ||
assignments it will align all sorts of things. | ||
|
||
This is a work in progress and I've published this bundle so people can give it | ||
a try. In the long term I hope this will get merged into TextMate. | ||
|
||
## Installation | ||
|
||
gem install json | ||
cd ~/Library/Application\ Support/Avian/Bundles | ||
git clone https://github.com/mads379/align.tmbundle.git | ||
|
||
## How to add alignment rules | ||
|
||
Open the bundle editor (ctrl+alt+cmd+b). Find the Align bundle. Hit `cmd+n` and | ||
choose settings. Set the scope you want, fx `source.ruby` and add something like | ||
the following. | ||
|
||
{ shellVariables = ( | ||
{ name = 'TM_SOURCE_ALIGNMENT_PATTERN'; | ||
value = '[ | ||
{ | ||
"regexp" : "=>", | ||
"spacing" : "before" | ||
}, | ||
{ | ||
"regexp" : ":", | ||
"spacing" : "after" | ||
}]'; | ||
}, | ||
); | ||
} | ||
|
||
The `value` is a simply a JSON array with objects that has a `regexp` and `spacing` | ||
property. The `regexp` is the regular expression to match after and spacing can be | ||
either `before` or `after` depending on weather you want in insert the spaces before | ||
or after the matched text. | ||
|
||
## Missing features | ||
|
||
- Left/right justify captures | ||
- Enable scope specific block separators (currently uses blank lines and indentation to find blocks of code) | ||
|
||
## History | ||
|
||
- Original discussion: http://old.nabble.com/Align-Source-td31636561.html | ||
- Original proof of concept: https://gist.github.com/988793 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters