I am using vim-jsbeautify and I think it is awesome.
However I would like to add the reformatting on the save action. At the moment I have to press Ctrl-f each time I want to reformat. I tried
autocmd FileType html AutoFormatBuffer :call HtmlBeautify()<cr>
but somehow that command is wrong, could someone please clarify?
Update
Just as @Ingo Karkat mentioned. For this case create a file in
~/.vim/ftplugin/html/main.vim
and add the line into the file
autocmd BufWritePre <buffer> call HtmlBeautify()