Align code by regex!
Based roughly on the amazing Sublime extension AlignTab that I miss dearly.
Find it here: https://github.com/randy3k/AlignTab
- Align by user defined regex that doesn't block your code!
- Auto expand to applicable lines!
- Select the exact lines and limit the number of columns to align!
- Wildcard matches
Command | Description |
---|---|
realign.activate |
Start Aligning |
Enter |
Confirm input |
Esc |
Cancel input |
To start aligning move your cursor to a block of code you wish to align. Then activate the extension (I use Alt+A) and type the pattern to align on.
Confirm your alignment with Enter
and cancel it with Escape
.
To limit the lines that get aligned simply highlight the lines you wish to include.
In addition to your regex you can enter advanced options by entering input in the form of [regex]/[options].
Add padding using options l
, r
, or c
/lN
adds N spaces to left of the regex matches/rN
adds N spaces to right of the regex matches/cN
adds N spaces to left and right of the regex matches/lNrM
adds N left and M right
Limit the number of times per line you match using f
/fN
limits each line to N matches
:
would match every colon:/f2
would match the first 2 colons:/l3f2
would match the first 2 colons and add 3 spaces to their left
We shall find out.
Initial release
Initial release of ReAlign