Can't get “Syntastic” vim plugin to work

前端 未结 2 1559
长情又很酷
长情又很酷 2021-02-12 20:14

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

2条回答
  •  轮回少年
    2021-02-12 21:00

    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 \"\ lacks \\\"summary\\\" attribute\"" 
    

提交回复
热议问题