up vote 0 down vote favorite
share [g+] share [fb]

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')

link|improve this question

55% accept rate
I'd write a function to do that and make it act on a range – Daenyth Jul 16 '10 at 20:53
feedback

2 Answers

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

%!column -t
link|improve this answer
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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