welovewordpress / SublimeHtmlTidy

Tidy, clean and prettify your HTML code with this plugin for Sublime Text 2
GNU General Public License v2.0
88 stars 15 forks source link

Tighter formatting #27

Open pjaj opened 11 years ago

pjaj commented 11 years ago

Is there any way of adjusting the settings so that it formats things similar to list items on one line instead of three? Dreamweaver formats HTML this way and you can see far more code per page without loss of clarity. Maybe it could be made an option ?

fitnr commented 11 years ago

Set "indent": "auto" or "false" in the user preferences.

pjaj commented 11 years ago

It won't accept "indent": auto. "auto" is displayed with a red background and on saving "Error in trying to parse settings: Expected value in C:" "indent": false suppresses all indentation completely, lining everything up on the left. Although it does do what I want otherwise, put each list item and its contents on a single line. You need the line-by-line indentation to see the structure, ideally a half way house between the true and false settings.

fitnr commented 11 years ago

It should be quoted. Sounds like there's a typo in the file. Did you add a comma to the previous line?

pjaj commented 11 years ago

Previous line already had a comma, here is a snippet either side of the line in question.

// This option specifies if Tidy should begin each attribute on a new line. "indent-attributes": false,

// This option specifies how Tidy should indent tags. // possible values: true, auto, false // "auto" doesn't seem to work with PHP Tidy library "indent": true,

//This option specifies the number of spaces Tidy uses to indent content "indent-spaces": 4,

all I tried was changing true to false and auto

realrandal commented 11 years ago

Write like this:

"indent-attributes": "auto",

"indent": "auto"