views:

225

answers:

2

I've installed Syntastic plugin in vim. I can't get it to work. I've tried :SyntasticEnable but no luck. SyntasticEnable python in my vimrc doesn't work either (in fact, it doesn't even parse the command, an error is shown when I try to add it to my .vimrc : Not an editor command: SyntasticEnable python).

How can I know what's going on? Syntastic isn't showing errors when I call it from vim. Does the first error (not and editor command in my .vimrc) indicates something I'm unaware of?

I have in my .vimrc:

set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_enable_signs=1
let g:syntastic_auto_loc_list=1

I have a python.vim in ~/.vim/syntax_checkers as well. I can already use Pyflakes for python files, it works GREAT but I would like to have Syntastic functionality in other files/extensions I need when developing applications.

A: 

Do you have the python syntax checker plugin installed and have you defined a statusline flag as such set statusline+=%*?

Ben Hoffstein
Yes. There's a python.vim in syntax_checker dir in my ~/.vim and I have set statusline in my vimrc. I've updated my question with more info.
Somebody still uses you MS-DOS
+1  A: 

Is pyflakes on your environment path? If it is not, then you must add it to your path, or modify syntax\checkers\python.vim and add the full path to the binary. There are two lines you have to modify:

if !(executable("pyflakes"))

and also

let makeprg = 'pyflakes %'

In my case. I wanted Syntastic to work with PHP on my Windows machine. So I had to modify those two similar lines in php.vim to be:

let s:php_executable = "C:\\Uniserver\\usr\\local\\php\\php.exe"
if !(executable(s:php_executable))

and

let makeprg = php_executable . " -l %"

If your path contains spaces, you'll have to surround them in double quotes in the makeprg variable. Also with html.vim, the single quotes in makeprg must be replaced with double quotes, (you'll have to re-escape everything inside).

let s:libfolder = "C:\\Program Files (x86)\\GnuWin32\\bin\\"
let s:tidyexe = s:libfolder . "tidy.exe"
let s:grepexe = s:libfolder . "grep.exe"
if !executable(s:tidyexe) || !executable(s:grepexe)

and

let makeprg="\"".s:tidyexe."\" -e % 2>&1 \\| \"".s:grepexe."\" -v \"\<table\> lacks \\\"summary\\\" attribute\"" 
James
I'm using Linux, isn't supposed to work out-of-box? Did you try to use "SyntasticEnable" in your .vimrc and check if you get the same error as me?
Somebody still uses you MS-DOS
It should work "out of the box" if you run pyflakes without an explicit path, i.e. just type "pyflakes myfile" in the terminal. (I don't use SyntasticEnable in my _vimrc file because that gets the same error as you.) What file type are you using syntastic to check? You might not have the required binaries, i.e. HTML requires tidy and Javascript requires jsl.
James
pyflakes is working, I'm having problems with syntastic. I'm going to look for the binaries you're saying it. Thanks!
Somebody still uses you MS-DOS
You're right, I need the executables. I'm entering in each <syntax>.vim file in syntax_checkers dir to know which executables are used. Thanks!
Somebody still uses you MS-DOS