sublime_alignment icon indicating copy to clipboard operation
sublime_alignment copied to clipboard

idea: generally align most similar characters between lines

Open devinrhode2 opened this issue 12 years ago • 3 comments

I like to vertically align all similar code, not just assignments. For example, this:

var home = document.getElementById('home');
var longerVariableName = document.getElementById('otherThing');

Changes to this:

var home               = document.getElementById('home');
var longerVariableName = document.getElementById('otherThing');

There could be many scenarios where some some automatic vertical alignment would make the code much more awesome and readable

I know my example used assignments, I scanned briefly over some of my code and I couldn't find a good example of doing vertical alignment beyond assignments right away. Regardless, the idea is out there for discussion :)

devinrhode2 avatar Jul 23 '13 00:07 devinrhode2

The above code is much more readable because of all the shared characters on the right side of the assignment, = document.getElementById('

devinrhode2 avatar Jul 23 '13 00:07 devinrhode2

Could even be expanded to align the ending parens:

var home               = document.getElementById('home'      );
var longerVariableName = document.getElementById('otherThing');

devinrhode2 avatar Jul 23 '13 00:07 devinrhode2

Maybe you could edit the original example with the commented one, since the OP is probably how it behaves right now.

ktaragorn avatar Aug 14 '13 04:08 ktaragorn