How to set up syntastic for vim?
Asked Answered
N

4

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!

Nostrum answered 17/3, 2013 at 5:38 Comment(0)
N
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.

Nostrum answered 17/3, 2013 at 6:15 Comment(1)
IIRC, YouCompleteMe and Syntastic have slightly overlapping features. You may double check YCM's doc for possible incompatibilities.Inaccurate
C
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.)

Chloris answered 18/3, 2013 at 6:36 Comment(0)
N
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.

Nostrum answered 17/3, 2013 at 6:15 Comment(1)
IIRC, YouCompleteMe and Syntastic have slightly overlapping features. You may double check YCM's doc for possible incompatibilities.Inaccurate
F
0

Installing clang and/or ctags packages fixed this for me

Funiculus answered 31/8, 2013 at 3:0 Comment(0)
H
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.

Honegger answered 3/6, 2018 at 19:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.