~gpanders/dotfiles

ecc325eaa35ab41dd8d873b0d4c0071edecef4af — Greg Anders 2 years ago c597c6a
[vim] Add clangtidy compiler
3 files changed, 23 insertions(+), 4 deletions(-)

M vim/.vim/after/plugin/dispatch.vim
A vim/.vim/compiler/clangtidy.vim
M vim/.vim/vimrc
M vim/.vim/after/plugin/dispatch.vim => vim/.vim/after/plugin/dispatch.vim +2 -3
@@ 6,11 6,10 @@ augroup Dispatch
  autocmd!

  " C/C++
  autocmd FileType c,cpp let b:dispatch = 'cppcheck %:S'
  autocmd FileType c,cpp let b:dispatch = 'clang-tidy -quiet %:S'

  " Python
  autocmd FileType python let b:start = 'ipython'
                      \ | let b:dispatch = 'pylint -f parseable -s no -- %:S'
  autocmd FileType python let b:dispatch = 'pylint -f parseable -s no -- %:S'

  " TeX
  autocmd FileType tex let b:dispatch = 'chktex -q -v0 -- %:S'

A vim/.vim/compiler/clangtidy.vim => vim/.vim/compiler/clangtidy.vim +20 -0
@@ 0,0 1,20 @@
" Clang-tidy compiler plugin
" Maintainer: Greg Anders <greg@gpanders.com>
" Last Updated: 1/2/2019

if exists('current_compiler')
  finish
endif
let current_compiler = 'clangtidy'

CompilerSet makeprg=clang-tidy\ -quiet\ %:S
CompilerSet errorformat=
      \%-G%*\\d\ %s\ generated.,
      \%-GError\ while\ processing\ %f.,
      \%E%f:%l:%c:\ fatal\ error:\ %m,
      \%E%f:%l:%c:\ error:\ %m\ [%s],
      \%W%f:%l:%c:\ warning:\ %m\ [%s],
      \%I%f:%l:%c:\ note:\ %m,
      \%-Z%p%^,
      \%C%.%#
      " \%-G%\m%\%%(LLVM\ ERROR:%\|No\ compilation\ database\ found%\)%\@!%.%#,

M vim/.vim/vimrc => vim/.vim/vimrc +1 -1
@@ 477,7 477,7 @@ augroup vimrc
  " }}}

  " Open the quickfix window after any quickfix command
  au QuickFixCmdPost [^l]* cwindow
  " au QuickFixCmdPost [^l]* cwindow

  " Start insert immediately when terminal opens
  if exists('##TermOpen')