8

So I git cloned the repository to ~/.vim/bundle and had pathogen installed. I can be sure pathogen works fine since my other plugins in bundle are all working fine. After googling for a while, it seems that syntastic should work out of box for c code. I also checked that I have all the executables specified in syntastic/syntax_checkers/c/.

Here is a part of my .vimrc file:

" syntastic
let g:syntastic_auto_loc_list=1
let g:syntastic_disabled_filetypes=['html']
let g:syntastic_enable_signs=1

When I open a *.c file and do :SyntasticCheck, nothing happens. There is no errors complaining command not found, so syntastic is loaded. However, even if the *.c file that's currently opened contains errors syntax error, syntastic is not showing anything.

It is the first time I use syntastic so I don't really know the correct way to invoke it.

I also tried :SyntasticCheck [c] and I get the following error message:

Error detected while processing function <SNR>_22_UpdateErrors..<SNR>22_CacheErrors:
line 16:
E121: Undefined variable: checkers
E15: Invalid expression: checkers

Can someone tell me what I did wrong and how to invoke syntastic? Thanks!

tgeng
  • 1,768
  • 2
  • 15
  • 20

4 Answers4

7

Try adding this to your vimrc:

let g:syntastic_check_on_open=1
let g:syntastic_enable_signs=1

(This is lifted straight from my vimrc, which has some other Syntastic settings if you'd like.)

KevinG
  • 882
  • 3
  • 16
  • 33
Evan Hahn
  • 12,147
  • 9
  • 41
  • 59
3

I don't really understand the reason, but when I re-installed the YouCompleteMe plugin for vim with ./install.sh --clang-completer. Syntastic works like charm.

tgeng
  • 1,768
  • 2
  • 15
  • 20
  • 1
    IIRC, YouCompleteMe and Syntastic have slightly overlapping features. You may double check YCM's doc for possible incompatibilities. – romainl Mar 17 '13 at 11:30
0

Installing clang and/or ctags packages fixed this for me

glebtv
  • 3,739
  • 1
  • 22
  • 10
0

I did two things and then Syntastic started to behave as expected with JS files and ESlint. Can't tell which one did the trick:

1- In the project's directory ran eslint --init.

2- Started vim opening the file without the -S flag.

Before it failed silently, no errors and no diagnostics. This is how ESlint behaves when there is no configuration file.

Juan Lanus
  • 2,293
  • 23
  • 18