use js-beautify from Vim
JavaScript Vim script
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 3 commits ahead of bigfish:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
after/ftplugin
bin
README.mkd

README.mkd

Vim JS Beautify

Uses Node.js to run js-beautify on the current buffer.

Requires: Node.js

Usage:

:JSBeautify

Processes whole file by default, but using a range may also work.

You could map to a key in .vimrc, eg:

nmap <leader>b :JSBeautify<cr>

Warning: may take a while for large files