Sublime Forum

Column select at EOLs--pad with spaces?

#1

Hey All,

I’ve got lines like this:

bibbity
boo
bobbity
yo

And I want to turn those into:

bibbity     : zip
boo         : zoobity
bobbity     : zop
yo          : pudding

(Note the pretty alignment.)

My instinct is to do column select along the right side of my original lines & then start typing, but the select follows the ragged right edge of the lines if you know what I mean, so it’s not easy to type nicely aligned colons.

Is there a way to get sublime to stay in the same column as I extend the selection downward, whether or not the text on the lines reaches that far, and have it insert spaces to make up any short lines. Or am I doomed to have to visit each line & do my own space-padding manually?

If anyone can tell what the heck I’m trying to ask…

Thanks!

-Roy

0 Likes

#2

I use this plugin:
wbond.net/sublime_packages/alignment
I make my column selection on the ragged edge, hit cmd+option+a (that’s what I’ve bound it to) and then everything’s aligned like magic.

0 Likes

#3

Thanks much for the response! That doesn’t actually work for the example I gave (I guess b/c of the colons?) but that example is of course made-up–most times it is equal signs I want to align around. So this is a 95% fix for me…

Thanks!

-Roy

0 Likes

#4

While the alignment plugin will align equals signs in one selection, it will also will align selections on multiple lines. This second case is the one that’s relevant to you: column select along the right (or select all the lines, cmd+shift+l, cmd+right), press your “align” shortcut, then press ": " and all you have left to do is write out your puddings.

0 Likes

#5

Ah, that’s perfect–many thanks!

0 Likes