vim-autoformat/ftplugin/javascript.vim

28 lines
713 B
VimL
Raw Normal View History

if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
"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"
let s:arguments = "-i"
2012-12-01 12:53:11 -05:00
let s:bundleDir = fnamemodify(expand("<sfile>"), ":h:h:h")
let s:prgpath = s:bundleDir."/js-beautify/python/".s:prgname
if executable(s:prgpath)
"If js-beautify is installed as a bundle
let &formatprg=s:prgpath." ".s:arguments
else
"Else look for js-beautify globally
"or in the formatters/folder
call g:FindFormatter(s:prgname,s:arguments)
endif
2012-10-09 19:04:23 -04: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