Merge py cli and js cli js-beautify definitions.

This commit is contained in:
Chiel ten Brinke 2017-06-23 09:07:06 +02:00
parent 31c2de2398
commit 889665717c
2 changed files with 43 additions and 48 deletions

View File

@ -140,14 +140,10 @@ if !exists('g:formatdef_jsbeautify_javascript')
elseif filereadable(expand('~/.jsbeautifyrc')) elseif filereadable(expand('~/.jsbeautifyrc'))
let g:formatdef_jsbeautify_javascript = '"js-beautify"' let g:formatdef_jsbeautify_javascript = '"js-beautify"'
else else
let g:formatdef_jsbeautify_javascript = '"js-beautify -X -f - -".(&expandtab ? "s ".shiftwidth() : "t").(&textwidth ? " -w ".&textwidth : "")' let g:formatdef_jsbeautify_javascript = '"js-beautify -X -".(&expandtab ? "s ".shiftwidth() : "t").(&textwidth ? " -w ".&textwidth : "")'
endif endif
endif endif
if !exists('g:formatdef_pyjsbeautify_javascript')
let g:formatdef_pyjsbeautify_javascript = '"js-beautify -X -".(&expandtab ? "s ".shiftwidth() : "t").(&textwidth ? " -w ".&textwidth : "")." -"'
endif
if !exists('g:formatdef_jscs') if !exists('g:formatdef_jscs')
let g:formatdef_jscs = '"jscs -x"' let g:formatdef_jscs = '"jscs -x"'
endif endif
@ -207,7 +203,6 @@ if !exists('g:formatters_javascript')
let g:formatters_javascript = [ let g:formatters_javascript = [
\ 'eslint_local', \ 'eslint_local',
\ 'jsbeautify_javascript', \ 'jsbeautify_javascript',
\ 'pyjsbeautify_javascript',
\ 'jscs', \ 'jscs',
\ 'standard_javascript', \ 'standard_javascript',
\ 'xo_javascript' \ 'xo_javascript'
@ -221,18 +216,14 @@ if !exists('g:formatdef_jsbeautify_json')
elseif filereadable(expand('~/.jsbeautifyrc')) elseif filereadable(expand('~/.jsbeautifyrc'))
let g:formatdef_jsbeautify_json = '"js-beautify"' let g:formatdef_jsbeautify_json = '"js-beautify"'
else else
let g:formatdef_jsbeautify_json = '"js-beautify -f - -".(&expandtab ? "s ".shiftwidth() : "t")' let g:formatdef_jsbeautify_json = '"js-beautify -".(&expandtab ? "s ".shiftwidth() : "t")'
endif endif
endif endif
if !exists('g:formatdef_pyjsbeautify_json')
let g:formatdef_pyjsbeautify_json = '"js-beautify -".(&expandtab ? "s ".shiftwidth() : "t")." -"'
endif
if !exists('g:formatters_json') if !exists('g:formatters_json')
let g:formatters_json = [ let g:formatters_json = [
\ 'jsbeautify_json', \ 'jsbeautify_json',
\ 'pyjsbeautify_json',
\ ] \ ]
endif endif

4
samples/test.json Normal file
View File

@ -0,0 +1,4 @@
{
"test": "test",
"test": [1, 2, 3]
}