[TxMt] Elastic tabstops
Chris Poirier
cpoirier at gmail.com
Tue Jul 4 13:56:09 UTC 2006
Hey Drew,
> ---------- Forwarded message ----------
> From: Drew McLellan <lists at allinthehead.com>
>
> I'd like to see this as an editing mode, automatically managing real
> tabs/spaces for me.
>
> I use tabs for aligning assignment blocks, and so often find myself
> going back up to add extra tabs when the left side of the assignments
> becomes longer than I expected. Example (using 4 spaces for a tab here):
>
> $a = 'A';
> $bb = 'B';
> $ccc = 'C';
>
> If I were to enter a forth line with a really long variable name, I'd
> *love* for the behaviour to be result in:
>
> $a = 'A';
> $bb = 'B';
> $ccc = 'C';
> $really_long_name = 'foo';
>
> .. but for that to be done with real tabs. I think the suggested
> convention of using a blank line to clear the alignment is a good one.
>
> Not sure if that's useful input or not, but there you have it :)
I've built a TM filter command that will realign assignment blocks.
It'll run on the current selection or on a block of statements
touching the current line. You can find it at
http://random-dreams.org/freeware/textmate/assignment-block-tidier.txt.
It's been on my shortlist since then to write a version that can
realign entire statements, lining up commas and closing parenthesis
and such. I'll probably get to that this month.
Regards,
Chris.
More information about the textmate
mailing list