Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Join all lines with tabs inserted (vim)

Tags:

vim

tabs

I have a tab delimited file (one line). I can easily enough replace the tabs with new lines so that I can see what fields are in what position

:%s/\t/\r/g

How can I do the inverse, after I've edited the fields? I could record a macro:

Js<tab>Esc

And then repeat it all the way down - but is there an easier way?

like image 373
EMiller Avatar asked Jan 07 '10 00:01

EMiller


1 Answers

How about this:

:%s/\n/\t/
like image 167
martin clayton Avatar answered Oct 10 '22 06:10

martin clayton