Skip to content

Instantly share code, notes, and snippets.

@letusfly85
Created September 20, 2017 08:07
Show Gist options
  • Save letusfly85/09145b71528c4cf614826a9ba5423f42 to your computer and use it in GitHub Desktop.
Save letusfly85/09145b71528c4cf614826a9ba5423f42 to your computer and use it in GitHub Desktop.

http://myenigma.hatenablog.com/entry/2016/01/10/215846

brew install clang-format
function! CPPCodeCleanup()
  " echo "Cleanup cpp code"
  let l:lines="all"
  let g:clang_format_fallback_style = 'Google'
  :pyf /usr/local/share/clang/clang-format.py
endfunction
command! CPPCodeCleanup call CPPCodeCleanup()

autocmd BufWrite *.{cpp} :CPPCodeCleanup
autocmd BufWrite *.{hpp} :CPPCodeCleanup
autocmd BufWrite *.{c} :CPPCodeCleanup
autocmd BufWrite *.{h} :CPPCodeCleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment