You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a Sublime Text 2 and 3 plugin allowing you to format your HTML, CSS, JavaScript, JSON and Vue code. It uses a set of nice beautifier scripts made by Einar Lielmanis. The formatters are written in JavaScript, so you'll need something (node.js) to interpret JavaScript code outside the browser.
7
+
This is a Sublime Text 2 and 3 plugin allowing you to format your HTML, CSS, JavaScript, JSON, React and Vue code. It uses a set of nice beautifier scripts made by Einar Lielmanis. The formatters are written in JavaScript, so you'll need something (node.js) to interpret JavaScript code outside the browser.
8
8
9
-
This will work with either HTML, CSS, JavaScript, JSON and Vue files.
9
+
This will work with either HTML, CSS, JavaScript, JSON, React and Vue files.
10
10
11
11
## Installation
12
12
First of all, be sure you have [node.js](http://nodejs.org/#download) installed in order to run the beautifier. After you've installed node.js, you will need to setup this plugin.
@@ -47,7 +47,7 @@ Right click in the current buffer and select `HTML/CSS/JS Prettify` -> `Prettify
47
47
48
48
-- or --
49
49
50
-
Open a HTML, CSS, JavaScript, JSON or Vue file, pop out the console in Sublime Text from View -> Show Console, and type `view.run_command("htmlprettify")`.
50
+
Open a HTML, CSS, JavaScript, JSON, React or Vue file, pop out the console in Sublime Text from View -> Show Console, and type `view.run_command("htmlprettify")`.
51
51
52
52
Writing commands in the console is ugly. Set up your own key combo for this, by going to Preferences -> Key Bindings - User, and adding a command in that array: `{ "keys": ["super+shift+h"], "command": "htmlprettify" }`. You can use any other command you want, thought most of them are already taken.
53
53
@@ -66,6 +66,12 @@ On Windows, the absolute path to node.exe *must* use forward slashes. Must inclu
66
66
### Be very careful on Linux!
67
67
Depending on your distribution and default package sources, `apt-get install node` (for example) *will not* install node.js, contrary to all human common sense and popular belief. You want `nodejs` instead. Best thing is to make it yourself from http://nodejs.org/#download.
68
68
69
+
## Beautify Vue
70
+
To properly beautify Vue files, make sure the file syntax is recongnized by Sublime as either HTML, XML or Vue.
71
+
72
+
## Beautify JSX
73
+
To properly beautify JSX files, make sure the file syntax is recongnized by Sublime as JavaScript and that `e4x` is `true` in your `.jsbeautifyrc`.
74
+
69
75
## Beautify on Save
70
76
To beautify your code when saving the document, set the `format_on_save` setting to `true` in `HTMLPrettify.sublime-settings`:
0 commit comments