Find file
Fetching contributors…
Cannot retrieve contributors at this time
62 lines (42 sloc) 2.07 KB


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.


cd ~/Library/Application\ Support/Avian/Bundles
git clone

How to add alignment rules

Open the bundle editor (ctrl+alt+cmd+b). Find the Align bundle. Hit cmd+n and choose settings.

In the new setting item, first set its name (something like Alignment Patterns (yourLanguage) and scope (e.g source.yourLanguage). Then add something like the following as content for the setting:

{ shellVariables = (
      value = '[
        "regexp" : "=>", 
        "padding" : "before"
        "regexp" : ":", 
        "padding" : "after"

value is a JSON array containing a list of regexp and spacing properties.

regexp is a regular expression which will capture your alignment string. It could be as simple as "=".

padding can be set to before or after depending on whether you to insert the padding spaces before or after the alignment string.

minimum_spacing_before and minimum_spacing_after can be set to define the minimum spacing there should be before/after the matched symbol.


You might want a more complex regular expression to capture the alignment string. For instance to capture any of =,+=, -=, *=, /=, the following would work:


Missing features

  • Left/right justify captures
  • Enable scope specific block separators (currently uses blank lines and indentation to find blocks of code)