0

Consider the following text that I would be typing into sublime. These would be notes I am taking for server/software installations.

Setting Ant : 345
Setting Cat : 690
Setting Weird : 1035
Setting Energetic : 1380
Setting Tortoise : 1725

I want to align the data based on the farthest first colon. So the end result would look something like this:

Setting Ant       : 345
Setting Cat       : 690
Setting Weird     : 1035
Setting Energetic : 1380
Setting Tortoise  : 1725

Macros seems like the way to go for this but I don't see how I could use the to query this information in order to pad the correct amount of spaces. Macro here seem to be defined constant instructions.

Is there a way in Sublime Text 3 that I can take the first block of text and render it to the second code block i.e how can I shift all the text to the right of and including the colon so that they all line up?

1 Answer 1

1

Using sublime? That's easy = Sublime Alignment

https://www.granneman.com/webdev/editors/sublime-text/packages/how-to-install-and-use-sublime-alignment/

will do it for you.

4
  • Easier than trying to roll my own I suppose. Thanks. Never actually used the word "align" in my search.
    – Matt
    May 30, 2017 at 19:45
  • @Matt I would have never know about it, but it's one of the top 25 used packages, which I checked when I started using sublime. packagecontrol.io/packages/Alignment
    – JustAGrump
    May 30, 2017 at 19:49
  • Now I just have to get the thing to work. Wonder if I have a hot key conflict :( (I did change the default so it is supposed to work with ":")
    – Matt
    May 30, 2017 at 19:52
  • I have KeePass so ctrl+alt+a is a conflict for me. Changing that should be good!. Thanks again.
    – Matt
    May 30, 2017 at 20:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .