Created
February 4, 2013 16:06
-
-
Save scrooloose/4707685 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"stick this in syntax_checkers/c/make.vim | |
"use let g:syntastic_c_checker="make" to activate it | |
function! SyntaxCheckers_c_make_IsAvailable() | |
return executable('make') | |
endfunction | |
function! SyntaxCheckers_c_make_GetLocList() | |
let makeprg = syntastic#makeprg#build({ | |
\ 'exe': 'make', | |
\ 'args': '-sk', | |
\ 'subchecker': 'make' }) | |
let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '. | |
\ 'identifier is reported only%.%#,%-G%f:%l: %#error: %#for '. | |
\ 'each function it appears%.%#,%-GIn file included%.%#,'. | |
\ '%-G %#from %f:%l\,,%f:%l:%c: %trror: %m,%f:%l:%c: '. | |
\ '%tarning: %m,%f:%l:%c: %m,%f:%l: %trror: %m,'. | |
\ '%f:%l: %tarning: %m,%f:%l: %m' | |
" process makeprg | |
let errors = SyntasticMake({ 'makeprg': makeprg, | |
\ 'errorformat': errorformat }) | |
" filter the processed errors if desired | |
if exists('g:syntastic_c_remove_include_errors') && | |
\ g:syntastic_c_remove_include_errors != 0 | |
return filter(errors, | |
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr('')) | |
else | |
return errors | |
endif | |
endfunction | |
call g:SyntasticRegistry.CreateAndRegisterChecker({ | |
\ 'filetype': 'c', | |
\ 'name': 'make'}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment