so if I have a list like
thing=34
otherthign=67
etc...
how do I :s/ it to get all the numbers aligned?

Follow

@Efi I'm assuming vim?

Easy way is with a plugin, there are plenty of nice ones for aligning things

Can't think of a good way of doing it with search and replace, but here's what I'd do:

:4,18norm 0f=20i<SPACE><Ctrl+V><ESC>d20|

4,18 is the range you're working on, 20 is which column you want the = to be after, set that higher than the length of anything that'll be on the left

Β· Β· 0 Β· 0 Β· 1

@Efi yeah, 0 puts you at the start of line, find the =, insert 20 spaces, delete backwards until you hit column 20

Sign in to participate in the conversation
Computer Fairies

Computer Fairies is a Mastodon instance that aims to be as queer, friendly and furry as possible. We welcome all kinds of computer fairies!