Sublime Forum

How can I align my CSS like this?

#1

Hi,
How can I align my CSS like this?

It would look great and very neat & clean if I can achieve this with a short key; thanks! :slight_smile:

0 Likes

#2

You can:

  1. Install the package https://packagecontrol.io/packages/AlignTab
  2. Select the lines you want to align
  3. Run the command Align Tab: By Regex
  4. Enter the regular expression \:

However, it will add spaces around the : as in:

 00 : 33 : 28 : 0296815
 00 : 33 : 29 : 0291761
 00 : 33 : 29 : 0291761
 00 : 33 : 29 : 0296731

I do not think it can align without adding those spaces. Then you can look into the package:

Or search for more packages on: https://packagecontrol.io/search/align

1 Like

#3

Perfect, I am using AlignTab :slight_smile:

0 Likes

#4

actually, you could use the options to control the padding, for example by using :/r0cl.

more examples could be found here: https://github.com/randy3k/AlignTab/wiki/Examples

1 Like