2012-12-15 05:05:34 -05:00
|
|
|
if exists("b:did_ftplugin")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let b:did_ftplugin = 1
|
|
|
|
|
2012-12-03 03:03:07 -05:00
|
|
|
"Besides installing the js-beautify globally or in the
|
|
|
|
"formatters/ folder, cloning the repository as a vim bundle
|
|
|
|
"is supported as well.
|
|
|
|
let s:prgname = "js-beautify"
|
2012-12-01 08:06:28 -05:00
|
|
|
let s:arguments = "-i"
|
2012-12-01 12:53:11 -05:00
|
|
|
|
2012-12-03 03:03:07 -05:00
|
|
|
let s:bundleDir = fnamemodify(expand("<sfile>"), ":h:h:h")
|
|
|
|
let s:prgpath = s:bundleDir."/js-beautify/python/".s:prgname
|
|
|
|
|
2012-12-01 08:06:28 -05:00
|
|
|
if executable(s:prgpath)
|
2012-12-03 03:03:07 -05:00
|
|
|
"If js-beautify is installed as a bundle
|
2013-02-08 14:05:52 -05:00
|
|
|
let b:formatprg=s:prgpath." ".s:arguments
|
2012-12-02 14:50:10 -05:00
|
|
|
else
|
2012-12-03 03:03:07 -05:00
|
|
|
"Else look for js-beautify globally
|
|
|
|
"or in the formatters/folder
|
|
|
|
call g:FindFormatter(s:prgname,s:arguments)
|
2012-12-01 08:06:28 -05:00
|
|
|
endif
|
2012-10-09 19:04:23 -04:00
|
|
|
|
2012-12-03 03:03:07 -05:00
|
|
|
"Set indenting behaviour to match with the formatter
|
2012-10-09 19:04:23 -04:00
|
|
|
set expandtab
|
2012-12-01 12:53:11 -05:00
|
|
|
set tabstop=4
|
|
|
|
set shiftwidth=4
|