Sublime Forum

Alignment for ST3

#1

Anyone know if Alignment is going to be ported for ST3 or if anyone knows how?

0 Likes

#2

There’s a fork by @kevinsperrine that is supposed to work according to:
github.com/wbond/sublime_alignm … t-17964523

I haven’t tested it myself. I rather prefer the “VAlign” plugin. (Not associated with VAlign, I’m just plugging it cause I like it.) There’s other alignment plugins as well.

Hope this helps,
Alex

0 Likes

#3

[quote=“quodlibet”]There’s a fork by @kevinsperrine that is supposed to work according to:
github.com/wbond/sublime_alignm … t-17964523

I haven’t tested it myself. I rather prefer the “VAlign” plugin. (Not associated with VAlign, I’m just plugging it cause I like it.) There’s other alignment plugins as well.

Hope this helps,
Alex[/quote]

I don’t see ST3 support or a ST3 branch, do you run it in ST3 without problems?

0 Likes

#4

The comment I linked to tells you what to do.

The idea is to get this branch from @kevinsperrine’s fork of alignment:
github.com/kevinsperrine/sublim … ee/python3

And include it in your Packages folder. (It will override the Alignment plugin if in your Installed Packages, if you have it installed.)

P.S. I haven’t used it myself, but people don’t generally post complete nonsense on github. (Generally :smile: )

Alex

0 Likes

#5

[quote=“quodlibet”]The comment I linked to tells you what to do.

The idea is to get this branch from @kevinsperrine’s fork of alignment:
github.com/kevinsperrine/sublim … ee/python3

And include it in your Packages folder. (It will override the Alignment plugin if in your Installed Packages, if you have it installed.)

P.S. I haven’t used it myself, but people don’t generally post complete nonsense on github. (Generally :smile: )

Alex[/quote]

I was referring to Valign, I gave that a try and it does look good.
One thing I don’t like about it though, if I select multiple lines it won’t line them all up properly if there are newlines between some of the lines.

0 Likes

#6

Sorry! I misunderstood. VAlign is compatible with both ST2 & 3.

Yeah, VAlign is kind of limited in how it works, but, honestly, it’s the first alignment plugin I’ve managed to use consistently, because it’s so easy to trigger.

Why don’t you try opening an issue about your use case? (Actually I just looked and I think you have?)

Alex

0 Likes

#7

[quote=“quodlibet”]

Sorry! I misunderstood. VAlign is compatible with both ST2 & 3.

Yeah, VAlign is kind of limited in how it works, but, honestly, it’s the first alignment plugin I’ve managed to use consistently, because it’s so easy to trigger.

Why don’t you try opening an issue about your use case? (Actually I just looked and I think you have?)

Alex[/quote]

Yeah I posted an issue regarding it. I do like how easily it can be triggered, but I frequently want to align with new line, for example when I am setting up constants and grouping them by likeness. I want them all aligned relative to each other, only way to do it with this plugin is to put them all together, align, then put the line breaks in.

0 Likes

#8

It’s not ideal, but it’s not too bad. You’ll eventually encounter situations where Valign completely misunderstands what you would like to happen and that’s more of a problem. I still dig the Ctrl+\ :smile:

0 Likes

#9

[quote=“quodlibet”]

It’s not ideal, but it’s not too bad. You’ll eventually encounter situations where Valign completely misunderstands what you would like to happen and that’s more of a problem. I still dig the Ctrl+\ :smile:[/quote]

I might give the other alignment a try, it’s based off regular expressions, but I suspect it will take a long time to get them all setup the way you want, and I would like to avoid all that if at all possible.

0 Likes

#10

did you try aligntab?
github.com/randy3k/AlignTab

0 Likes

#11

[quote=“randy3k”]did you try aligntab?
github.com/randy3k/AlignTab[/quote]

Not yet, but was on my list.
I’ve been looking at other options first as I hear that one is a real pain setting up all the Regex.

0 Likes

#12

@Saxi If you’re tesing out alternatives and you find a plugin that you prefer to VAlign, do be a gentleman and post about it here.

Edit: the regex stuff looks annoying to set up, but on the other hand, if you only have to do it once per syntax… that’s not too bad.

0 Likes

#13

[quote=“quodlibet”]@Saxi If you’re tesing out alternatives and you find a plugin that you prefer to VAlign, do be a gentleman and post about it here.

Edit: the regex stuff looks annoying to set up, but on the other hand, if you only have to do it once per syntax… that’s not too bad.[/quote]

I will but I really think the regex one is the only other option.
You maybe right, but I believe one syntax is likely to involve a ton of regex’s, and would want multiple syntaxes.

0 Likes

#14

[quote=“Saxi”]

[quote=“quodlibet”]@Saxi If you’re tesing out alternatives and you find a plugin that you prefer to VAlign, do be a gentleman and post about it here.

Edit: the regex stuff looks annoying to set up, but on the other hand, if you only have to do it once per syntax… that’s not too bad.[/quote]

I will but I really think the regex one is the only other option.
You maybe right, but I believe one syntax is likely to involve a ton of regex’s, and would want multiple syntaxes.[/quote]

But more true is that different syntaxes should have different alignment patterns. There is no such thing as universal alignment patterns. Thus, It makes sense to setup regex per syntax.

0 Likes

#15

I’m warming up to @randy3k’s AlignTab.

One of the things I’ve had desperate need for is rudimentary tabular data in Markdown – so rudimentary, in fact, that the various table plugins don’t support it. Here’s what I’ve wanted:

- lorem ipsum dolor sit amet  | consectetur adipisicing elit | sed do eiusmod
- tempor incididunt ut labore | ut enim ad minim veniam      | reprehenderit in voluptate
- quis nostrud exercitation   | ullamco laboris nisi ut      | aliquip ex ea commodo

I can align this quickly with the following beast:

    {
        "keys": "ctrl+\\"],
        "command": "align_tab",
        "args": { "user_input" : "\\|" },
        "context":  { "key": "selector", "operator": "equal", "operand": "text.plain, text.html.markdown", "match_all": true } ]
    },

I’m using the same binding that VAlign uses but it only kicks in for plain text and markdown (where I don’t need to align things, in general, and where VAlign stumbles).

/me is very happy :smile:

0 Likes