diff --git a/README.md b/README.md index 536b2ff..3be72b5 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ Here is the link to the repository: https://github.com/vvakame/typescript-format It is shipped with `sass`, a CSS preprocessor written in Ruby, which can be installed by running `gem install sass`. Here is the link to the SASS homepage: http://sass-lang.com/. -* `tidy` for __XHTML__ and __XML__. +* `tidy` for __HTML__, __XHTML__ and __XML__. It's probably in your distro's repository, so you can download it as a regular package. For Ubuntu type `sudo apt-get install tidy` in a terminal. diff --git a/plugin/defaults.vim b/plugin/defaults.vim index 75d74d6..51f9dd3 100644 --- a/plugin/defaults.vim +++ b/plugin/defaults.vim @@ -51,13 +51,6 @@ if !exists('g:formatters_java') endif -" HTML -let g:formatdef_htmlbeautify = '"html-beautify -f - -s ".&shiftwidth' -if !exists('g:formatters_html') - let g:formatters_html = ['htmlbeautify'] -endif - - " Javascript let g:formatdef_jsbeautify_javascript = '"js-beautify -f - -".(&expandtab ? "s ".&shiftwidth : "t").(&textwidth ? " -w ".&textwidth : "")' let g:formatdef_pyjsbeautify_javascript = '"js-beautify -".(&expandtab ? "s ".&shiftwidth : "t").(&textwidth ? " -w ".&textwidth : "")." -"' @@ -82,6 +75,28 @@ if !exists('g:formatters_json') endif +" HTML +let g:formatdef_htmlbeautify = '"html-beautify -f - -s ".&shiftwidth' +let g:formatdef_tidy_html = '"tidy -q --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -wrap ".&textwidth' +if !exists('g:formatters_html') + let g:formatters_html = ['htmlbeautify', 'tidy_html'] +endif + + + +" XML +let g:formatdef_tidy_xml = '"tidy -q -xml --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -wrap ".&textwidth' +if !exists('g:formatters_xml') + let g:formatters_xml = ['tidy_xml'] +endif + + +" XHTML +let g:formatdef_tidy_xhtml = '"tidy -q --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -asxhtml -wrap ".&textwidth' +if !exists('g:formatters_xhtml') + let g:formatters_xhtml = ['tidy_xhtml'] +endif + " Ruby let g:formatdef_rbeautify = '"rbeautify ".(&expandtab ? "-s -c ".&shiftwidth : "-t")' if !exists('g:formatters_ruby') @@ -110,20 +125,6 @@ if !exists('g:formatters_typescript') endif -" XML -let g:formatdef_tidy_xml = '"tidy -q -xml --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -wrap ".&textwidth' -if !exists('g:formatters_xml') - let g:formatters_xml = ['tidy_xml'] -endif - - -" XHTML -let g:formatdef_tidy_xhtml = '"tidy -q --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -asxhtml -wrap ".&textwidth' -if !exists('g:formatters_xhtml') - let g:formatters_xhtml = ['tidy_xhtml'] -endif - - " Golang let g:formatdef_gofmt_1 = '"gofmt -tabs=".(&expandtab ? "false" : "true")." -tabwidth=".&shiftwidth' let g:formatdef_gofmt_2 = '"gofmt"'