" Vim configuration for clang-format integration " Format on save for C++ files " Python 3 support if has('python3') map :py3f /path/to/clang-format.py imap :py3f /path/to/clang-format.py endif " Python 2 support if has('python') map :pyf /path/to/clang-format.py imap :pyf /path/to/clang-format.py endif " Format on save function! Formatonsave() let l:formatdiff = 1 py3f /path/to/clang-format.py endfunction autocmd BufWritePre *.h,*.cc,*.cpp call Formatonsave()