maksimr/vim-jsbeautify

when i use vim js format , is wrong

q2qiang opened this issue · 3 comments

image

;.editorconfig

root = true

[**.js]
path=~/.vim/bundle/js-beautify/js/lib/beautify.js
bin=node
indent_style = space
indent_size = 4

[**.css]
path=~/.vim/bundle/js-beautify/js/lib/beautify-css.js
indent_style = space
indent_size = 4

[**.html]
indent_style = space
indent_size = 4

@q2qiang Did you define g:config_Beautifier in .vimrc?

yeah ,i can use it ,but it is wrong

image

@q2qiang g:config_Beautifier should contain dict/map, not a string with a path. So in your case you should use g:editorconfig_Beautifier

You can also configure a variable g: config_Beautifier(g:config_Beautifier has type dict), but it is better to use the .editorconfig file.

To assign a custom path for the .editorconfig file set the variable g:editorconfig_Beautifier.

https://github.com/maksimr/vim-jsbeautify/blob/master/README.md

Thanks!