Syntastic for Vim on Cygwin, Unable to Set Shellslash

219 views Asked by At

I'm using Vim on Cygwin and I've recently decided to attempt to install some plugins. I installed Vundle and managed to get the vim-airline plugin working, but for some reason I cannot get Syntastic to work.

My vimrc:

set nocompatible
filetype off

set rtp+=c:/cygwin64/home/USERNAME/.vim/bundle/Vundle.vim
call vundle#begin('c:/cygwin64/home/USERNAME/.vim/bundle/')
Plugin 'VundleVim/Vundle.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'vim-syntastic/syntastic'
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

call vundle#end()
filetype plugin indent on

I believe syntastic downloaded properly as it updates when I run :PluginInstall and :PluginUpdate from within Vim.

When I open a .py file with the .vimrc above, I receive the following error:

syntastic: error: checker python/python returned abnormal status 2

From sniffing around I learned that from within Vim, the following can be helpful in diagnosing syntastic problems.

:let g:syntastic_debug=3
:w
:mes

One of the portions of the :mes returns

syntastic: 73.033500: checker output: ['C:\Python36\python.exe: can''t open file ''/home/USERNAME/.vim/
bundle/syntastic/syntax_checkers/python/compile.py'': [Errno 2] No such file or directory', '']

After a little more digging I found that my shellslash variable may not be set, which is causing Windows filepaths to be interpreted as UNIX filepaths (or vice versa). Other people found this portion of the :mes return helpful:

syntastic: 72.928500: &shell = '/bin/bash', &shellcmdflag = '-c', &shellpipe = '2>&1| tee', &shellqu
ote = '', &shellredir = '>%s 2>&1', &shelltemp = 1, &shellxquote = '', &autochdir = 0, &shellxescape
 = ''

I added a line to my .vimrc, set shellslash, yet after I saved it and reopened vim, nothing changed (I tried adding it in several different places, like before the set rtp, after syntastic plugin call, and at the very end). I got the same error, and when I ran through the prompts for :mes again, there was no shellslash variable listed. The output looked exactly like above. I also tried :set shellslash from within Vim, and while no errors were thrown, the problem remained.

The last thing I could think of was that Vim was loading a different .vimrc file, so I ran :scriptnames but it returned in the top row the location of the .vimrc I've been editing.

So how do I set shellslash? I believe that might allow Syntastic to work properly in Vim on Cygwin.

0

There are 0 answers