From 091321ce4d32a2d124a803ac08bc0ba01cc154ed Mon Sep 17 00:00:00 2001 From: bbqtd Date: Mon, 31 Oct 2016 03:12:26 +0300 Subject: [PATCH] Add formatter for javascript (standard) --- README.md | 7 +++++++ plugin/defaults.vim | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fe06e6..0dab7aa 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,10 @@ Here is a list of formatprograms that are supported by default, and thus will be * `JSCS` for __Javascript__. http://jscs.info/ +* `standard` for __Javascript__. + 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/. + * `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. @@ -303,6 +307,9 @@ contact me by creating an issue in this repository. ## Change log +### October 2016 +* Add `standard` formatter for JavaScript. + ### April 2016 * Add `yapf` as a secondary Python formatter. diff --git a/plugin/defaults.vim b/plugin/defaults.vim index 9a21f34..47d024e 100644 --- a/plugin/defaults.vim +++ b/plugin/defaults.vim @@ -152,11 +152,16 @@ if !exists('g:formatdef_jscs') let g:formatdef_jscs = '"jscs -x"' endif +if !exists('g:formatdef_standard_javascript') + let g:formatdef_standard_javascript = '"standard --fix --stdin"' +endif + if !exists('g:formatters_javascript') let g:formatters_javascript = [ \ 'jsbeautify_javascript', \ 'pyjsbeautify_javascript', - \ 'jscs' + \ 'jscs', + \ 'standard_javascript' \ ] endif