Invoke js-beautify in Vim
1) Install js-beautify
npm install -g js-beautify
2) Map js-beautify to ,ff (if your leader is ,):
nnoremap <leader>ff :%!js-beautify -j -q -B -f -<CR>
3) Customize the options the way you want
js-beautify -h #will give you all options
There is no need for a vim plugin to do this for you and this way you can easily customize it the way you want.
Written by Thomas Peklak
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#