I have read this How can I autoformat/indent C code in vim? about how to format C/C++ code, but I want to autoformat the code when I'm saving the file, like how vim-go calls gofmt
when saving Golang code.
How can I configure my vimrc? I'm using clang-format, and have installed vim-clang-format with spf13vim using Vundle.