sublimetextsublimetext3sublime-text-plugin

How can I compress multiple lines of code into 1 line of code?


I have many similar block of code like this :

        imgLoader({
            img: $chImage,
            btn: $btnAssignment,
            imgPath: basePath + '04-Section Exercise/Assignment.png'
        });

I want to compress them into 1 line.

imgLoader({ img: $chImage, btn: $btnAssignment, imgPath: basePath + '04-Section Exercise/Assignment.png' });

I did this one manually, and it takes me about 10 seconds. Imagine doing 100 of these is clearly not fun. I'm wondering if there is any Sublime Text 3 package/ plug-in that can help me do that.


Solution

  • It turn out that in Sublime Text, we can accomplish this such task, but just highlighting the texts, and press :

    - Mac OS X : cmd + j

    - Windows : ctr + j

    Note: This will work only one way.