How can I merge multiple lines into one line in Vim?

Viewed 77849

For example, I want to merge such text:

CATEGORIES = ['Books',
        'Business',
        'Education',
        'Entertainment',
        'Finance',
        'Games',
        'Healthcare & Fitness',
        'Lifestyle',
        'Medical',
        'Music',
        'Navigation',
        'News',
        'Photography',
        'Productivity',
        'Reference',
        'Social Networking',
        'Sports',
        'Travel',
        'Utilities',
        'Weather',
        'All',  ]

into

CATEGORIES = ['Books', 'Business', 'Education', 'Entertainment', 'Finance', 'Games', 'Healthcare & Fitness', 'Lifestyle', 'Medical', 'Music', 'Navigation', 'News', 'Photography', 'Productivity', 'Reference', 'Social Networking', 'Sports', 'Travel', 'Utilities', 'Weather', 'All', ]
6 Answers
Related