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
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#