From 896998c368b34d9016fc1f76b595054947656745 Mon Sep 17 00:00:00 2001 From: Steve Dignam Date: Mon, 22 Feb 2016 14:55:23 -0500 Subject: [PATCH] updated js-beautify formatter to use config file --- plugin/defaults.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugin/defaults.vim b/plugin/defaults.vim index a710ff0..01ba6d1 100644 --- a/plugin/defaults.vim +++ b/plugin/defaults.vim @@ -84,7 +84,13 @@ endif " Javascript if !exists('g:formatdef_jsbeautify_javascript') - let g:formatdef_jsbeautify_javascript = '"js-beautify -f - -".(&expandtab ? "s ".shiftwidth() : "t").(&textwidth ? " -w ".&textwidth : "")' + if filereadable('.jsbeautifyrc') + let g:formatdef_jsbeautify_javascript = '"js-beautify"' + elseif filereadable(expand('~/.jsbeautifyrc')) + let g:formatdef_jsbeautify_javascript = '"js-beautify"' + else + let g:formatdef_jsbeautify_javascript = '"js-beautify -f - -".(&expandtab ? "s ".shiftwidth() : "t").(&textwidth ? " -w ".&textwidth : "")' + endif endif if !exists('g:formatdef_pyjsbeautify_javascript')