Sublime Forum

The most flexible alignment tool: AlignTab

#1

I would say it is the most flexible alignment tool for Sublime ever exists.

github.com/randy3k/AlignTab

Table mode

0 Likes

#2

This looks interesting (and complicated :wink:. I’ll definitively give it a try.

0 Likes

#3

it’s complicated, but you have controls of everything.

  1. Use regular expression rather than pre-defined delimiters.
  2. Options to control left/right/center alignment.
  3. Maximum number of splits.
0 Likes

#4

hi,

is it possible to specify multiple characters to align on?
For example open and closing braces.

from

foo(bar) foo1(bar1)

make

foo (bar) foo1 (bar1)

Regards

0 Likes

#5

No idea what you mean… You must specify a regular expression, not a character.
Isn’t (.*?) working for this example ?

0 Likes

#6

hi,

thanks, yes your regex is working for the example above. However, I want to align also on all closing braces (sorry, i forgot that in the example above).

Thus, from

foo(bar) foo1(bar1)
make

foo (bar ) foo1 (bar1)

0 Likes

#7
\(|\)/l1c0l0c0

Not sure it works.
This plugin give me headaches every time I use it :wink:

1 Like

#8

Its working! Thanks a lot!

0 Likes

#9

I have updated the plugin to make it more friendly to new users.
Check it out~
github.com/randy3k/AlignTab

0 Likes

#10

Thank you very much for such a great plugin!

0 Likes

#11

I love this plug in! But one small hiccup with any == found. They become = = when aligning to first =
so this:

$fieldAutoPopulate == ("true") ? $autoPop = "checked" : $autoPop = "";

becomes

$fieldAutoPopulate = = ("true") ? $autoPop = "checked" : $autoPop = "";

and it doesn’t work anymore.

0 Likes

#12

try

(?<!=)=(?!=)/f

however, if you use this, it will align the equal sign in $autoPop = "checked"

Auto line detection will become not reliable in this situation.
In this case, you may want to highlight the piece of code before applying the alignment.

0 Likes

#13

FWIW – I outlined a useful (?) use case for tabular data in Markdown here: viewtopic.php?f=2&t=12606&start=10#p49982

0 Likes

#14

[quote=“bizoo”]\(|\)/l1c0l0c0
Not sure it works.
This plugin give me headaches every time I use it :wink:[/quote]

That’s why you can save the regexp as a predefined pattern, so your head only will ache once. :smile:

0 Likes

#15

I am now opening a wiki page for examples.
So, it would be nice if you can provide your examples to the wiki~

github.com/randy3k/AlignTab/wiki/Examples

0 Likes

#16

Awesome plugin, thank you! But how do you turn off Table Mode? :confused:

0 Likes

#17

while you are in table mode, you can press to escape table mode

0 Likes

#18

Would you mind removing the context menuitems and place these in commands instead? These take the place of Cut, Copy and Paste
Currently maintain the ontology of the menus, is complicated, because we lack some sort of organization… and mutations(features)… but everyone can help… :slight_smile:

0 Likes

#19

not works. Text is still aligned and statusbar still shows “[Table Mode]”

P.S: Using Regex is very slow when aligning large table (painful when in Table Mode). This makes SublimeTableEditor superior in speed.
Maybe an option to disable Regex possible?

0 Likes

#20

should exit the table mode. could you tell me what version of st and platform you are using?

SublimeTableEditor is definitely superior in a lot of aspects in table editing as aligntab aims for general purpose.
However, i am working in a way to improve the speed.

0 Likes