Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 299
code-8 Avatar asked Oct 28 '25 08:10

code-8


1 Answers

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.

like image 157
code-8 Avatar answered Oct 31 '25 12:10

code-8



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!