Many times, we want to format the HTML-CSS-JS code, the site has a lot of tools to implement this feature, of course, my Site home page also has. But wouldn't it be quicker and easier if we had such a feature on the Code editor? So, let's take a look at how sublime Text 3 uses plug-ins to implement this feature!
first, the necessary conditions:
1, first, you have to have sublime Text 3 editor;
2, you local to configure the Nodejs environment (installation method can be consulted: node. JS Learning notes);
3, your sublime Text 3 editor to install HTML-CSS-JS prettify plug-in (installation method can refer to: Sublime Common plug-in summary).
second, the installation process:
1. We open the sublime Text 3 editor and install the Html-css-js prettify plugin.
A) in Sublime Text 3, press Ctrl+shift+p to bring up the command panel;
b) Enter install to bring up the Install Package option and enter;
c) Enter pretty and select Html-css-js prettify in the list and enter to install.
2. View the local installed Nodejs configuration environment path (under DOS command, enter where node and return).
3. In any of the html/js/css files in the editor, right-click, appear as shown, select Set Plugin options.
4. Save the Nodejs local path in step 2 above to the file opened in step 3 as shown in.
5, successfully installed HTML-CSS-JS prettify plug-in.
three, do a demo:
1, the original HTML template, the chaos is unbearable.
2, right click, select Prettify Code.
3. Format the result.
Format code using the Html-css-js prettify plugin for sublime Text 3