Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a list of columns in vim:

column_foo
, column_foobar
, column_really_way_to_long
, column_prefixfoo_prefixbar_really way to long

I want these to become padded and joined such that it looks something like this

, foo     ,  bar    ,  baz    ,  quz_quadazzel
, foobar  ,  moono  ,  bleh   ,  bleh  

Is there an easy sequence of commands that I can do for this? In addition, I'd like to know how to pad a visual block to a specific amount of characters.

foobar
, baz
, z
, really_long_column_of_stuff

I.e, how can I right pad to make all of the columns length(' , really_long_column_of_stuff')

share|improve this question
    
I'd write a function to do that and make it act on a range –  Daenyth Jul 16 '10 at 20:53
    
When you use placeholders 'foo', 'bar', etc., make sure you keep the same placeholders in subsequent examples so it is clear how you want them to be processed. That's what placeholders are for. Right now, it seems like you want to change words as well or something, and I can't easily say how you want to transform the original expression. I'm just saying this so you can make it easier for people to help you, and thus get more answers. –  Daniel Andersson Mar 8 '12 at 12:49
    
lol, get real.. –  Evan Carroll Mar 8 '12 at 14:53

2 Answers 2

If you are on Linux, this neat little trick will work:

%!column -t
share|improve this answer

Have a look at the Align plugin. Here are some examples of its capabilities.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.