依赖vim-jsbeautifyjs-beautifyjs-beautify的安装:1 2 3 npm -g install js-beautify # 或 pip install jsbeautifier 配置快捷键1 2 3 4 vmap <leader>jsb :'<,'>!js-beautify -i<CR> autocmd FileType javascript noremap <buffer> <leader>jsb :call JsBeautify()<CR> autocmd FileType html noremap <buffer> <leader>htmlb :call HtmlBeautify()<CR> autocmd FileType css noremap <buffer> <leader>cssb :call CSSBeautify()<CR>