Sublime Forum

The most flexible alignment tool: AlignTab

#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

#21

I’m using ST3 buld 3056 - Windows 7 x32

0 Likes

#22

do you still have problem with exiting the table mode?

0 Likes

#23

I tested in ST3 on Windows 8 64bit and it doesn’t seem do have any problems.

0 Likes

#24

using it in CSS, is there a way to add “{” as an align mode, in the right click interface?
adding it to the settings file does not seem to affect it.

(except regexp)

0 Likes

#25

[quote=“sneila”]using it in CSS, is there a way to add “{” as an align mode, in the right click interface?
adding it to the settings file does not seem to affect it.

(except regexp)[/quote]

you can create your own Context.sublime-menu and put it under User.

0 Likes

#26

So f*****g sexy. Imagine the possibilities!

0 Likes

#27

Hey all. I don’t know much about regex, but this tool looks like it would be perfect for aligning verilog port lists. Could anyone help me figure out how to configure it to turn code like this:

input [17:0] SW, // write enable, write address, input data input [0:0] KEY, // reset input CLOCK_50, // 50 MHz clock output [0:0] LEDG, // write enable output [0:6] HEX7, // write address output [0:6] HEX6, // write address output [0:6] HEX5, // data in output [0:6] HEX4, // data in output [0:6] HEX3, // read address output [0:6] HEX2, // read address output [0:6] HEX1, // data output output [0:6] HEX0, // data output output [17:0] LEDR // switches
into code like this:

input [17:0] SW , // write enable, write address, input data input [0 :0] KEY , // reset input CLOCK_50, // 50 MHz clock output [0 :0] LEDG , // write enable output [0 :6] HEX7 , // write address output [0 :6] HEX6 , // write address output [0 :6] HEX5 , // data in output [0 :6] HEX4 , // data in output [0 :6] HEX3 , // read address output [0 :6] HEX2 , // read address output [0 :6] HEX1 , // data output output [0 :6] HEX0 , // data output output [17:0] LEDR // switches
Thanks.

0 Likes

#28

it is hard to align table with missing values. My suggestion is to use

\s*

and then edit the table manually for the missing cells.

0 Likes

#29

Hi,
First of all, thank your for the plugin it is very usefull.

However, i have a question:
I want to align the following case:

signal sig1 : std_logic := 0;
signal sig2 : std_logic_vector( 3 downto 0 ) := x"4";
signal sig_out : std_logic := 1;

If i use the plugin to align lines according to ‘:’, ia have a wrong behavior. The result is

signal sig1    : std_logic                      : = 0;
signal sig2    : std_logic_vector( 3 downto 0 ) : = x"4";
signal sig_out : std_logic                      : = 1;

The problem is that plugin align lines according to ‘:’ but also according to ‘:=’ which i don’t want. Moreover, character ‘:’ is not equivalent to ‘:=’ so why plugin make this alignment ?
Thanks

0 Likes

#30

In your case the function First Colon : in the AlignTab context menu item would solve the problem.

You can also run AlignTab from Command Palette and enter the regexp :(?!=)

0 Likes

#31

Ok, i’ve missed the operation available in the context menu.
Thanks.

I’ve another problem. For example i’ve the following code (language is VHDL but whatever):

p_release: process(nRst, ClkSys)
begin
   if (nRst = '0') then
      toto                <= (others=>'0');
   elsif rising_edge(ClkSys) then
      if (cs_controlReg = '1') and (wr_en = c_WE_active) then
         if Addr(5 downto 0) = c_addr(7 downto 2) then
            toto(0)   <= Data_in( 0);
            toto(1)   <= Data_in(16);
         else
            toto      <= (others => '0');
         end if;
      else
         toto        <= (others => '0');
      end if;
   end if;
end process;

As you can see, there is many indentation level. But if i want to align all symbol “<=”, it will work but the indentation will be broken:

p_release: process(nRst, ClkSys)
begin
   if (nRst = '0') then
      toto    <= (others=>'0');
   elsif rising_edge(ClkSys) then
      if (cs_controlReg = '1') and (wr_en = c_WE_active) then
         if Addr(5 downto 0) = c_addr(7 downto 2) then
      toto(0) <= Data_in( 0);
      toto(1) <= Data_in(16);
         else
      toto    <= (others => '0');
         end if;
      else
      toto    <= (others => '0');
      end if;
   end if;
end process;

Did i made a wrong operation or is it a real plugin issue?

0 Likes