Aligning two columns of text in Vim

Viewed 88

I want to align the below code:

Sample Code:

.abc  (abc)
.bcd (dfdfd) 
.xyzdddddd            (xyzdfdd)

After alignment:

.abc        (abc)
.bcd        (dfdfd)
.xyzdddddd  (xyzdfdd) 

How can we align this with Vim?

2 Answers

If you're on linux, you can call an external tool to do the job (no need for a plugin):

:%!column -t

See help range!:

:{range}![!]{filter} [!][arg]                           :range!
                        Filter {range} lines through the external program
                        {filter}...
Related