Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I minify html, css, js/jquery and ruby code inside Sublime Text 3?

Tags:

sublimetext3

Running Windows 7. What is the best Sublime Text 3 plugin to do this, and maybe beautify the code as well.

like image 565
Starkers Avatar asked Aug 19 '13 18:08

Starkers


People also ask

How do I minify in Sublime Text?

Installation. Once you install Package Control, restart Sublime Text and bring up the Command Palette ( Command+Shift+P on OS X, Control+Shift+P on Linux/Windows). Select “Package Control: Install Package”, wait while Package Control fetches the latest package list, then select Minifier when the list appears.

How do I beautify HTML code in Sublime Text 3?

Beautify on Save sublime-settings : Ctrl+Shift+P or Cmd+Shift+P in Linux/Windows/OS X.

How do you minify source code?

Go to minifycode.com and click the CSS minifier tab. Then paste the CSS code into the input box and click the Minify CSS button. After the new minified code is generated, copy the code. Then go back to the css file of your website and replace the code with the new minified version.


2 Answers

May be useful, this shortcut will erase all line breaks of the selected text

Ctrl + J

Notice this is not really minify, since it doesn't consider the code language.

like image 147
Kanabos Avatar answered Oct 20 '22 16:10

Kanabos


You may have already found something you like by now, but I just ran across this same need and have tried out two plugins: Minifier and Clientside. Clientside has more features like linting and beautifying but is only compatible up to ST2 (according to its Package Control page), whereas Minifier should be compatible with ST3.

like image 28
Mark Avatar answered Oct 20 '22 17:10

Mark