Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Tabularize plugin

Tags:

vim

macvim

How can modify this…

pt1 = [0, 1, 0]
pt2 = [0.588, -0.809, 0]
pt3 = [-0.951, 0.309, 0]
pt4 = [0.951, 0.309, 0]
pt5 = [-0.588, -0.809, 0]

…to make it look like this…

pt1 = [     0,      1, 0]
pt2 = [ 0.588, -0.809, 0]
pt3 = [-0.951,  0.309, 0]
pt4 = [ 0.951,  0.309, 0]
pt5 = [-0.588, -0.809, 0]

…using the Tabularize plugin? It's all about regular expressions and I could not find one that works in this case.

like image 783
sidyll Avatar asked Jan 25 '11 17:01

sidyll


1 Answers

I make it this

:Tabularize /[,[]/l1c0r0c1r0c1r0

The spacing after the commas isn't quite right when I try Peter's suggestion, so I modified it slightly.

like image 87
Greg Sexton Avatar answered Sep 20 '22 10:09

Greg Sexton