I'm using vim in cygwin, I want to use https://github.com/maksimr/vim-jsbeautify to format my javascript code. but whenever I use :call JsBeautify(), there's an error thrown:

E117: Unknown function:JsBeautify

Whenever I press the keys I mapped for calling JsBeautify, following error occurs:

enter image description here

  • 1
    Maybe it's this issue? Commented Mar 10, 2015 at 9:37
  • yeah, maybe, I find that thread too. But to change the vim script of a plugin seems a little too complex for me. So I've chose another approach. I've post an answer to my own question.
    – Aaron Shen
    Commented Mar 11, 2015 at 2:08

1 Answer 1


I didn't find a solution to resolve this issue directly, but I find another Plugin: https://github.com/Chiel92/vim-autoformat. To use this plugin to format javascript, you have to install a global js-beautify node module first:

npm install -g js-beautify

After the npm module is installed, the plugin will automatically detect it and format js code properly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.