From d16e82d468eb0d5bb1e662ac4812c0ca6fc0fc64 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Tue, 25 Feb 2020 14:47:03 +0300 Subject: reorganized repo to be easier to use with GNU stow; added script to stow --- dotfiles/.vim/autoload/neomake/makers/ft/cpp.vim | 50 ++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 dotfiles/.vim/autoload/neomake/makers/ft/cpp.vim (limited to 'dotfiles/.vim/autoload/neomake/makers/ft/cpp.vim') diff --git a/dotfiles/.vim/autoload/neomake/makers/ft/cpp.vim b/dotfiles/.vim/autoload/neomake/makers/ft/cpp.vim new file mode 100644 index 0000000..0cfa877 --- /dev/null +++ b/dotfiles/.vim/autoload/neomake/makers/ft/cpp.vim @@ -0,0 +1,50 @@ +" vim: ts=4 sw=4 et + +function! neomake#makers#ft#cpp#EnabledMakers() abort + let makers = executable('clang++') ? ['clang', 'clangtidy', 'clangcheck'] : ['gcc'] + call add(makers, 'cppcheck') + return makers +endfunction + +function! neomake#makers#ft#cpp#clang() abort + let maker = neomake#makers#ft#c#clang() + let maker.exe = 'clang++' + let maker.args += ['-std=c++1z'] + return maker +endfunction + +function! neomake#makers#ft#cpp#gcc() abort + let maker = neomake#makers#ft#c#gcc() + let maker.exe = 'g++' + let maker.args += ['-std=c++1z'] + return maker +endfunction + +function! neomake#makers#ft#cpp#clangtidy() abort + return neomake#makers#ft#c#clangtidy() +endfunction + +function! neomake#makers#ft#cpp#clangcheck() abort + return neomake#makers#ft#c#clangcheck() +endfunction + +function! neomake#makers#ft#cpp#cppcheck() abort + let maker = neomake#makers#ft#c#cppcheck() + let maker.args[0] = '--language=c++' + return maker +endfunction + +function! neomake#makers#ft#cpp#cpplint() abort + return { + \ 'exe': executable('cpplint') ? 'cpplint' : 'cpplint.py', + \ 'args': ['--verbose=3'], + \ 'errorformat': + \ '%A%f:%l: %m [%t],' . + \ '%-G%.%#', + \ 'postprocess': function('neomake#makers#ft#cpp#CpplintEntryProcess') + \ } +endfunction + +function! neomake#makers#ft#cpp#CpplintEntryProcess(entry) abort + let a:entry.type = str2nr(a:entry.type) < 5 ? 'W' : 'E' +endfunction -- cgit v1.2.3