Tuesday, September 6, 2011

Re: How can I select multiple lines that are not in a continuous chunk?

On 2011-09-05, at 2:59 PM, Tim Chase wrote:

1) use a decorate-tabularize-undecorate pattern, something like

 :'<,'>v/^\</-j!
 :'<,'>Tabularize
 :'<,'>s/,/,\r            /g

where the first one pulls everything onto its own line, the second one does the tabularization, and the third one puts things back on their own lines.  Adjust accordingly for your own code.


Thanks Tim! This regex works well, and I got the results I wanted.  

One note is that for those who use Tabularize you just have to change 
'<,'>Tabularize 
to
'<,'>Tabularize /= 

in order to align by "=".


Thanks,
-Kay Z

No comments: