I've added the following line to my .vimrc which runs JsBeautify every time I save a file:
au BufWritePre *.{js} :call JsBeautify()
Most of the time JsBeautify doesn't have any effect but replaces the whole content of the file leaving an extra step in the undo history. It should only edit the content of a file if there is a change.
I've added the following line to my
.vimrcwhich runsJsBeautifyevery time I save a file:Most of the time
JsBeautifydoesn't have any effect but replaces the whole content of the file leaving an extra step in the undo history. It should only edit the content of a file if there is a change.