Merge branch 'philolo1-config_formater'
This commit is contained in:
commit
1dcabd579f
@ -4,32 +4,47 @@
|
|||||||
|
|
||||||
|
|
||||||
" Python
|
" Python
|
||||||
let g:formatdef_autopep8 = '"autopep8 - --range ".a:firstline." ".a:lastline." ".(&textwidth ? "--max-line-length=".&textwidth : "")'
|
if !exists('g:formatdef_autopep8')
|
||||||
|
let g:formatdef_autopep8 = '"autopep8 - --range ".a:firstline." ".a:lastline." ".(&textwidth ? "--max-line-length=".&textwidth : "")'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:formatters_python')
|
if !exists('g:formatters_python')
|
||||||
let g:formatters_python = ['autopep8']
|
let g:formatters_python = ['autopep8']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
" C#
|
" C#
|
||||||
let g:formatdef_astyle_cs = '"astyle --mode=cs --style=ansi --indent-namespaces -pcH".(&expandtab ? "s".&shiftwidth : "t")'
|
if !exists('g:formatdef_astyle_cs')
|
||||||
|
let g:formatdef_astyle_cs = '"astyle --mode=cs --style=ansi --indent-namespaces -pcH".(&expandtab ? "s".&shiftwidth : "t")'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:formatters_cs')
|
if !exists('g:formatters_cs')
|
||||||
let g:formatters_cs = ['astyle_cs']
|
let g:formatters_cs = ['astyle_cs']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
" Generic C, C++, Objective-C
|
" Generic C, C++, Objective-C
|
||||||
let g:formatdef_clangformat = "'clang-format -lines='.a:firstline.':'.a:lastline.' --assume-filename='.bufname('%').' -style=\"{BasedOnStyle: WebKit, AlignTrailingComments: true, '.(&textwidth ? 'ColumnLimit: '.&textwidth.', ' : '').(&expandtab ? 'UseTab: Never, IndentWidth: '.&shiftwidth : 'UseTab: Always').'}\"'"
|
if !exists('g:formatdef_clangformat')
|
||||||
|
let g:formatdef_clangformat = "'clang-format -lines='.a:firstline.':'.a:lastline.' --assume-filename='.bufname('%').' -style=\"{BasedOnStyle: WebKit, AlignTrailingComments: true, '.(&textwidth ? 'ColumnLimit: '.&textwidth.', ' : '').(&expandtab ? 'UseTab: Never, IndentWidth: '.&shiftwidth : 'UseTab: Always').'}\"'"
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" C
|
" C
|
||||||
let g:formatdef_astyle_c = '"astyle --mode=c --style=ansi -pcH".(&expandtab ? "s".&shiftwidth : "t")'
|
if !exists('g:formatdef_astyle_c')
|
||||||
|
let g:formatdef_astyle_c = '"astyle --mode=c --style=ansi -pcH".(&expandtab ? "s".&shiftwidth : "t")'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:formatters_c')
|
if !exists('g:formatters_c')
|
||||||
let g:formatters_c = ['clangformat', 'astyle_c']
|
let g:formatters_c = ['clangformat', 'astyle_c']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
" C++
|
" C++
|
||||||
let g:formatdef_astyle_cpp = '"astyle --mode=c --style=ansi -pcH".(&expandtab ? "s".&shiftwidth : "t")'
|
if !exists('g:formatdef_astyle_cpp')
|
||||||
|
let g:formatdef_astyle_cpp = '"astyle --mode=c --style=ansi -pcH".(&expandtab ? "s".&shiftwidth : "t")'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:formatters_cpp')
|
if !exists('g:formatters_cpp')
|
||||||
let g:formatters_cpp = ['clangformat', 'astyle_cpp']
|
let g:formatters_cpp = ['clangformat', 'astyle_cpp']
|
||||||
endif
|
endif
|
||||||
@ -42,16 +57,28 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
" Java
|
" Java
|
||||||
let g:formatdef_astyle_java = '"astyle --mode=java --style=ansi -pcH".(&expandtab ? "s".&shiftwidth : "t")'
|
if !exists('g:formatdef_astyle_java')
|
||||||
|
let g:formatdef_astyle_java = '"astyle --mode=java --style=ansi -pcH".(&expandtab ? "s".&shiftwidth : "t")'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:formatters_java')
|
if !exists('g:formatters_java')
|
||||||
let g:formatters_java = ['astyle_java']
|
let g:formatters_java = ['astyle_java']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
" Javascript
|
" Javascript
|
||||||
let g:formatdef_jsbeautify_javascript = '"js-beautify -f - -".(&expandtab ? "s ".&shiftwidth : "t").(&textwidth ? " -w ".&textwidth : "")'
|
if !exists('g:formatdef_jsbeautify_javascript')
|
||||||
let g:formatdef_pyjsbeautify_javascript = '"js-beautify -".(&expandtab ? "s ".&shiftwidth : "t").(&textwidth ? " -w ".&textwidth : "")." -"'
|
let g:formatdef_jsbeautify_javascript = '"js-beautify -f - -".(&expandtab ? "s ".&shiftwidth : "t").(&textwidth ? " -w ".&textwidth : "")'
|
||||||
let g:formatdef_jscs = '"jscs -x"'
|
endif
|
||||||
|
|
||||||
|
if !exists('g:formatdef_pyjsbeautify_javascript')
|
||||||
|
let g:formatdef_pyjsbeautify_javascript = '"js-beautify -".(&expandtab ? "s ".&shiftwidth : "t").(&textwidth ? " -w ".&textwidth : "")." -"'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:formatdef_jscs')
|
||||||
|
let g:formatdef_jscs = '"jscs -x"'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:formatters_javascript')
|
if !exists('g:formatters_javascript')
|
||||||
let g:formatters_javascript = [
|
let g:formatters_javascript = [
|
||||||
\ 'jsbeautify_javascript',
|
\ 'jsbeautify_javascript',
|
||||||
@ -62,8 +89,14 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
" JSON
|
" JSON
|
||||||
let g:formatdef_jsbeautify_json = '"js-beautify -f - -".(&expandtab ? "s ".&shiftwidth : "t")'
|
if !exists('g:formatdef_jsbeautify_json')
|
||||||
let g:formatdef_pyjsbeautify_json = '"js-beautify -".(&expandtab ? "s ".&shiftwidth : "t")." -"'
|
let g:formatdef_jsbeautify_json = '"js-beautify -f - -".(&expandtab ? "s ".&shiftwidth : "t")'
|
||||||
|
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',
|
||||||
@ -73,8 +106,14 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
" HTML
|
" HTML
|
||||||
let g:formatdef_htmlbeautify = '"html-beautify -f - -s ".&shiftwidth'
|
if !exists('g:formatdef_htmlbeautify')
|
||||||
let g:formatdef_tidy_html = '"tidy -q --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -wrap ".&textwidth'
|
let g:formatdef_htmlbeautify = '"html-beautify -f - -s ".&shiftwidth'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:formatdef_tidy_html')
|
||||||
|
let g:formatdef_tidy_html = '"tidy -q --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -wrap ".&textwidth'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:formatters_html')
|
if !exists('g:formatters_html')
|
||||||
let g:formatters_html = ['htmlbeautify', 'tidy_html']
|
let g:formatters_html = ['htmlbeautify', 'tidy_html']
|
||||||
endif
|
endif
|
||||||
@ -82,41 +121,59 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
" XML
|
" XML
|
||||||
let g:formatdef_tidy_xml = '"tidy -q -xml --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -wrap ".&textwidth'
|
if !exists('g:formatdef_tidy_xml')
|
||||||
|
let g:formatdef_tidy_xml = '"tidy -q -xml --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -wrap ".&textwidth'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:formatters_xml')
|
if !exists('g:formatters_xml')
|
||||||
let g:formatters_xml = ['tidy_xml']
|
let g:formatters_xml = ['tidy_xml']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
" XHTML
|
" XHTML
|
||||||
let g:formatdef_tidy_xhtml = '"tidy -q --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".&shiftwidth." --vertical-space yes --tidy-mark no -asxhtml -wrap ".&textwidth'
|
if !exists('g:formatdef_tidy_xhtml')
|
||||||
|
let g:formatdef_tidy_xhtml = '"tidy -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:formatters_xhtml')
|
if !exists('g:formatters_xhtml')
|
||||||
let g:formatters_xhtml = ['tidy_xhtml']
|
let g:formatters_xhtml = ['tidy_xhtml']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Ruby
|
" Ruby
|
||||||
let g:formatdef_rbeautify = '"rbeautify ".(&expandtab ? "-s -c ".&shiftwidth : "-t")'
|
if !exists('g:formatdef_rbeautify')
|
||||||
|
let g:formatdef_rbeautify = '"rbeautify ".(&expandtab ? "-s -c ".&shiftwidth : "-t")'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:formatters_ruby')
|
if !exists('g:formatters_ruby')
|
||||||
let g:formatters_ruby = ['rbeautify']
|
let g:formatters_ruby = ['rbeautify']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
" CSS
|
" CSS
|
||||||
let g:formatdef_cssbeautify = '"css-beautify -f - -s ".&shiftwidth'
|
if !exists('g:formatdef_cssbeautify')
|
||||||
|
let g:formatdef_cssbeautify = '"css-beautify -f - -s ".&shiftwidth'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:formatters_css')
|
if !exists('g:formatters_css')
|
||||||
let g:formatters_css = ['cssbeautify']
|
let g:formatters_css = ['cssbeautify']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
" SCSS
|
" SCSS
|
||||||
let g:formatdef_sassconvert = '"sass-convert -F scss -T scss --indent " . (&expandtab ? &shiftwidth : "t")'
|
if !exists('g:formatdef_sassconvert')
|
||||||
|
let g:formatdef_sassconvert = '"sass-convert -F scss -T scss --indent " . (&expandtab ? &shiftwidth : "t")'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:formatters_scss')
|
if !exists('g:formatters_scss')
|
||||||
let g:formatters_scss = ['sassconvert']
|
let g:formatters_scss = ['sassconvert']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
" Typescript
|
" Typescript
|
||||||
let g:formatdef_tsfmt = '"tsfmt --stdin %"'
|
if !exists('g:formatdef_tsfmt')
|
||||||
|
let g:formatdef_tsfmt = '"tsfmt --stdin %"'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:formatters_typescript')
|
if !exists('g:formatters_typescript')
|
||||||
let g:formatters_typescript = ['tsfmt']
|
let g:formatters_typescript = ['tsfmt']
|
||||||
endif
|
endif
|
||||||
@ -125,8 +182,14 @@ endif
|
|||||||
" Golang
|
" Golang
|
||||||
" Two definitions are provided for two versions of gofmt.
|
" Two definitions are provided for two versions of gofmt.
|
||||||
" See issue #59
|
" See issue #59
|
||||||
let g:formatdef_gofmt_1 = '"gofmt -tabs=".(&expandtab ? "false" : "true")." -tabwidth=".&shiftwidth'
|
if !exists('g:formatdef_gofmt_1')
|
||||||
let g:formatdef_gofmt_2 = '"gofmt"'
|
let g:formatdef_gofmt_1 = '"gofmt -tabs=".(&expandtab ? "false" : "true")." -tabwidth=".&shiftwidth'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:formatdef_gofmt_2')
|
||||||
|
let g:formatdef_gofmt_2 = '"gofmt"'
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists('g:formatters_go')
|
if !exists('g:formatters_go')
|
||||||
let g:formatters_go = ['gofmt_1', 'gofmt_2']
|
let g:formatters_go = ['gofmt_1', 'gofmt_2']
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user