diff --git a/README.md b/README.md index 45bd4d9..3dca426 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,10 @@ Here is a list of formatprograms that are supported by default, and thus will be It can be installed by running `npm install -g standard` (`nodejs` is required). No more configuration needed. More information about the style guide can be found here: http://standardjs.com/. +* `xo` for __Javascript__. + It can be installed by running `npm install -g xo` (`nodejs` is required). + Here is the link to the repository: https://github.com/sindresorhus/xo. + * `html-beautify` for __HTML__. 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. @@ -307,6 +311,10 @@ contact me by creating an issue in this repository. ## Change log +### January 2017 + +* Add `xo` formatter for JavaScript. + ### March 2016 * Don't use the option formatprg internally anymore, to always have the possible of using the default `gq` command. diff --git a/plugin/defaults.vim b/plugin/defaults.vim index 333ed20..7d707c0 100644 --- a/plugin/defaults.vim +++ b/plugin/defaults.vim @@ -156,12 +156,17 @@ if !exists('g:formatdef_standard_javascript') let g:formatdef_standard_javascript = '"standard --fix --stdin"' endif +if !exists('g:formatdef_xo_javascript') + let g:formatdef_xo_javascript = '"xo --fix --stdin"' +endif + if !exists('g:formatters_javascript') let g:formatters_javascript = [ \ 'jsbeautify_javascript', \ 'pyjsbeautify_javascript', \ 'jscs', - \ 'standard_javascript' + \ 'standard_javascript', + \ 'xo_javascript' \ ] endif