From 46a36c8e3af922be6b5ffedd0f7aae16a65b1df3 Mon Sep 17 00:00:00 2001 From: Curtis Harvey Date: Fri, 30 May 2014 13:42:30 -0700 Subject: [PATCH] add CSS formatting (using `css-beautify`) to defaults --- README.md | 8 ++++++++ plugin/defaults.vim | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index 00d8ca2..0d1cadc 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,11 @@ It is shipped with `js-beautify`, which can be installed by running `npm install Note that `nodejs` is needed for this to work. Here is the link to the repository: https://github.com/einars/js-beautify. +* `css-beautify` for __CSS__. +It is shipped with `js-beautify`, which can be installed by running `npm install -g js-beautify`. +Note that `nodejs` is needed for this to work. +Here is the link to the repository: https://github.com/einars/js-beautify. + * `tidy` for __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. @@ -124,6 +129,9 @@ If you have any suggestions on this plugin or on this readme, if you have some n Change log ---------- +### May 30 2014 +* Added `css-beautify` to the defaults for formatting CSS files + ### December 20 2013 * `html-beautify` is now the default for HTML since it seems to be better maintained, and seems to handle inline javascript neatly. * The `formatters/` folder is no longer supported anymore, because it is unnecessary. diff --git a/plugin/defaults.vim b/plugin/defaults.vim index 2c39152..feff214 100644 --- a/plugin/defaults.vim +++ b/plugin/defaults.vim @@ -33,6 +33,11 @@ if !exists("g:formatprg_args_expr_xhtml") && !exists("g:formatprg_args_xhtml") let g:formatprg_args_expr_xhtml = '"-q --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -asxhtml -wrap ".&textwidth' endif +if !exists("g:formatprg_css") | let g:formatprg_css = "css-beautify" | endif +if !exists("g:formatprg_args_expr_css") && !exists("g:formatprg_args_css") + let g:formatprg_args_expr_css = '"-f - -s ".&shiftwidth' +endif + if !exists("g:formatprg_html") | let g:formatprg_html = "html-beautify" | endif if !exists("g:formatprg_args_expr_html") && !exists("g:formatprg_args_html") let g:formatprg_args_expr_html = '"-f - -s ".&shiftwidth'