Elastic tabstops - a better way to indent and align code - http://nickgravgaard.com/elastic...
"Each cell ends with a tab character. A column block is a run of uninterrupted vertically adjacent cells. A column block is as wide as the widest piece of text in the cells it contains or a minimum width (plus padding). Text outside column blocks is ignored." The page includes a Java applet demo of a simple editor which uses this concept. This actually looks pretty sweet. - ⓞnor
You mean, tabs should be 4 spaces? That's okay but did you read this article? - ⓞnor
It would require changes to any editor; I see no reason those changes would be harder (or easier) to make to vi. (The changes are to how tabs are rendered; actual editing is unchanged.) - ⓞnor
Those are good points about time travel, but this could be a relatively incremental improvement that would actually make things a lot better. Not that I'm about to adopt it or anything (as far as I know it is implemented only in gedit), but table-based layout of code fits the way I move code around better than the line-at-a-time reindenting most editors use. Maybe a good intermediate solution would be an editor that works with this model but translates it to a more conventional format on exit. - ⓞnor
I wasn't smart enough to make the demo do anything interesting for me, but what does this do that you can't do with the emacs commands that in/outdent the selected block of text? - j1m
j1m: try making one of the variable names (or types) much longer than it currently is. You'll see the entire next column of stuff shift over to adapt without you having to do anything special. Also, since it's only the rendering that's changing, and not the number of space characters on every affected line (as would be the case if you indented everything with spaces), your revision history will be cleaner: only the line you meant to edit will show up as "changed". - Laurence Gonsalves
What Laurence said -- try editing the "try making this comment a bit longer" text, or the "makeThisFunctionNameLonger()" function in front of it, and watch how things reflow. Or, edit the name of the someDemoCode function and watch the argument list move. Some of these things could be done through fixups and block-move commands, but I think this is quicker and better. - ⓞnor
@Laurence, yeah, the bit about the revision history seems pretty valuable. - j1m
What I want is something that can reflow gracefully to variable column widths, so we don't have to argue about 80 columns vs. 100 vs. whatever all the time. - ⓞnor
This makes sense to me. Neat find. - Jason Wehmhoener
Very interesting idea, seen it a few times before. Sad thing is that it isn't really supported anywhere I can find. I only indent with tabs myself, spaces are evil. I hate having to retab files that have to few/many spaces to be readable. =) - Daniel Bruce
omg i love you. <3 <3 <3 - Will Higgins™
I haven't tried this, but here's a related package for Emacs: http://www.emacswiki.org/emacs-e... - Amit Patel
The problem is that we still edit code's textual representation instead of structure. I'd be more of a fan of a 2d layout of code. - Jonas S Karlsson
@Jonas: Agreed. - Ihab Awad