Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: Aligning columns by whitespace

what for a regex is needed for formating some lines from

0 0 0      
00 00 00  
000 000 00
0 00 000 
000 00 0   
000 0 000

to

  0   0   0
 00  00  00
000 000 000
  0  00 000
000  00   0
000   0 000

?

TIA

like image 511
silvio Avatar asked Jan 21 '11 12:01

silvio


2 Answers

Watch this:

There are times when you can improve the readability of your code by lining up the elements on neighbouring lines. In this episode, I demonstrate how this can be achieved using the Tabular plugin...

like image 193
noodl Avatar answered Oct 13 '22 10:10

noodl


For such tasks, I'd take a look at "DrChips Alignment Tool for Vim"

like image 45
René Nyffenegger Avatar answered Oct 13 '22 12:10

René Nyffenegger