Chaining Alignments - cpmcgrath/codealignment GitHub Wiki

Alignment Chaining was introduced in Version 10.0.

Alignment Chaining is a fast way to perform multiple alignments over the same lines of code. Take the following alignment...

public string FirstName { get; set; }  =>  public  string  FirstName { get; set; }
public string Surname { get; set; }    =>  public  string  Surname   { get; set; }
public int Age { get; private set; }   =>  public  int     Age       { get; private set; }
private Address Address { get;  set; } =>  private Address Address   { get; set; }

As outlined in the Align by space tutorial, You would normally have your caret at the beginning of the first word, press Ctrl = space, move your caret to the start of the second word, press Ctrl = space, move your caret to the start of the third word, and press Ctrl = space again.

This isn't too bad, but you can see that it's pretty repetitive. Alignment chaining helps with this. With alignment chaining, put you caret at the start of the first word, and perform the following sequence keeping Ctrl pressed the whole time - Ctrl = space space space

The idea is pretty simple, when you perform an alignment, if you still have the ctrl key pressed Code alignment starts chaining alignments. This means that you can instantly hit the final key of a usual alignment chord to perform it, and that instead of being performed from the start of the line or from your caret, it is performed from the end of the last alignment.