Rylogic Text Aligner
Rylogic Text Aligner is an extension that adds a command to the edit menu for vertically aligning text. More than simply satisfying the obsessive compulsives out there, vertical text alignment is a powerful productivity aid when used in combination with column selection. Vertically aligned text also leverages your subconscious ability to spot patterns, making pattern-breaking bugs much easier to spot. Notice how much easier it is to spot the bug in the second of the following two code examples:
The Align command is available under the Edit -> Advanced Menu. For convenience however, I recommend creating a keyboard shortcut. Select Options from the Tools menu, and then Keyboard under the Environment section. Type "Edit.Align" into the search text field, then choose your keyboard shortcut, and click assign. E.g.
The first, and most basic use case, is to align assignments:
To align some text, move the caret onto a line of text within a block and hit your keyboard shortcut. The extension intelligently searches above and below the current caret position, identifies the alignment group nearest the caret and aligns the text. Note that alignment is not limited to just assignments, repeatedly pressing your keyboard shortcut will identify other alignment groups and align to those. For example, create a new text file and copy in the following text:
Now, move the caret to the position just after the 'r' in 'cucumber' and press your keyboard shortcut twice. The text should be aligned as follows:
You can also tell the extension to align to specific characters by selecting the text to align to before pressing your keyboard shortcut. For example, select a ';' character then align:
The character sequences recognised as 'align-able' are defined in the options. Select Options from the Tools menu, then Align Options under the Rylogic section.
These values are saved to an XML file in your AppData folder:
The top table contains the alignment groups, and the lower table contains the patterns that are all considered equivalent for a given group. In the image above, the group Comparisons consists of the patterns: