0

I want to preface by saying that I'm quite inexperienced with vimscript, so please bear with me. When I run SyntasticInfo I get the following:

Syntastic version: 3.7.0-199 (Vim 704, Windows)
Info for filetype: python
Global mode: active
Filetype python is active
The current file will be checked automatically
syntastic: error: checker output:
syntastic: error: checker python/python: can't parse version string (abnormal termination?)
Available checkers: flake8 pep8 pycodestyle pyflakes
Currently enabled checker: flake8

I have a suspicion that it has something to do with my shell var in my vimrc but I cannot figure out why it works when I first open an instance of gvim and on buffer switch.

Below is my vimrc:

"bundle management
set rtp+=$HOME\vimfiles\bundle\vim-colors-solarized
set rtp+=$HOME\vimfiles\bundle\syntastic
set rtp+=$HOME\vimfiles\bundle\SimpylFold
set rtp+=$HOME\vimfiles\bundle\vim-python-pep8-indent
set rtp+=$HOME\vimfiles\bundle\vim-flake8
set rtp+=$HOME\vimfiles\bundle\AsyncCommand

set nocompatible
filetype plugin indent on
syntax on
color solarized
autocmd BufEnter * silent! lcd %:p:h
"browse vert diffsplit
behave xterm
set expandtab
"set shell=powershell.exe\ -ExecutionPolicy\ Unrestricted
"\ -windowstyle\ hidden
set shell=cmd
set shellcmdflag=/c
set noshellslash
set shellpipe=>
set shellredir=>
set smartcase
set showcmd
set winaltkeys=no
set viminfo='100,f1,n$USERPROFILE\\_viminfo.txt
set lines=86
set columns=240
set mousemodel=popup
set clipboard=autoselect
set noswapfile
set autoread
set autowrite
set iskeyword+=.
set iskeyword+=&
set iskeyword+=$
set iskeyword+=%
set iskeyword+=:
set fileformats=dos,unix
set backspace=indent,eol,start
set ts=3
set autoindent
set ruler
set ignorecase
set number
set hlsearch
set modeline
set modelines=29
set guifont=Lucida_Console:h11:cANSI
set complete-=k complete+=k
set omnifunc=syntaxcomplete#Complete
set encoding=utf-8
set wildmenu
set wildmode=list:longest,full

""bad white space
highlight BadWhitespace ctermbg=red guibg=darkred
au BufRead,BufNewFile, *.c,*.h,*.sas match BadWhitespace /\s\+$/
"syntastic var
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_enable_highlighting=1
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_debug=8
au BufRead, *.py let g:syntastic_debug_file = "~/syntastic.log"
let g:syntastic_check_on_wq=0
let g:syntastic_python_checkers=['flake8']
let syntastic_nested_autocommands=1

"saves and loads folds in files that have them
au BufWinLeave * silent! mkview
au BufWinEnter * silent! loadview

augroup sascode
   au GuiEnter,BufEnter *.sas,*.log,*.lst    set makeprg=sas\ -nosplash\ -sysin\ %\ -log\ %:r.log\ -print\ %:r.lst
   au GuiEnter,BufEnter *.sas,*.log,*.lst,*.tcl    set ff=dos
   au GuiEnter,BufEnter *.sas,*.log,*.lst,*.tcl    setf sas
   au GuiEnter,BufEnter *.sas,*.log,*.lst,*.tcl    set lines=86 | set columns=240
   au GuiEnter,BufEnter *.sas,*.log,*.lst,*.tcl    color solarized
   au GuiEnter,BufEnter *.sas,*.log,*.lst,*.tcl    syntax on
   au GuiEnter,BufEnter *.sas,*.log,*.lst,*.tcl    set autoindent
augroup END

"Declare local buffer variables when entering a buffer if not already defined
au BufEnter,BufReadPost *.py,*.sas,*.lst,*.log call SetBVars("false")
au BufFilePost *.py,*.sas,*.lst,*.log call SetBVars("true") "after saveas command reset buffer vars

function! SetBVars(reset)
    if !exists("b:fileRoot") || a:reset=="true"
       let b:fileRoot = expand("%:p:r")
       let b:ssas     ='"'.b:fileRoot.'.sas"'
       let b:slog     ='"'.b:fileRoot.'.log"'
       let b:slst     ='"'.b:fileRoot.'.lst"'
       let b:sbat     ='"'.b:fileRoot.'.bat"'
       let b:spy      ='"'.b:fileRoot.'.py"'
       let b:sas      =b:fileRoot.'.sas'
       let b:log      =b:fileRoot.'.log'
       let b:lst      =b:fileRoot.'.lst'
       let b:bat      =b:fileRoot.'.bat'
       let b:py       =b:fileRoot.'.py'
    endif
endfun

au BufRead,BufNewFile *.ps1 set filetype=PowerShell
au! Syntax PowerShell source $HOME\syntax\ps1.vim

augroup XML
   au GuiEnter *.xml,*.XML    color solarized
   au GuiEnter *.xml,*.XML    set ts=3
   au GuiEnter *.xml,*.XML    setf xml
   au GuiEnter *.xml,*.XML    set ff=dos
   au GuiEnter *.xml,*.XML    set shiftwidth=3
   au GuiEnter *.xml,*.XML    set lines=80 | set columns=190
augroup END

augroup scripts
   au GuiEnter *.pl,*.sh,*.js,*htm,*.bat     :set makeprg=perl\ %
   au GuiEnter *.pl,*.sh,*.js,*htm,*.bat     color solarized
   au GuiEnter *.pl,*.sh,*.js,*htm,*.bat     set ts=3
   au GuiEnter *.pl,*.sh,*.js,*htm,*.bat     set ff=dos
   au GuiEnter *.pl,*.sh,*.js,*htm,*.bat     set shiftwidth=3
   au GuiEnter *.pl,*.sh,*.js,*htm,*.bat     set lines=60 | set columns=190
augroup END


augroup textfiles
   au GuiEnter *.txt,*.TXT    set wrapmargin=10
   au GuiEnter *.txt,*.TXT    color solarized
   au GuiEnter *.txt,*.TXT    set textwidth=130
   au GuiEnter *.txt,*.TXT    set lines=70 | set columns=220
   au GuiEnter *.txt,*.TXT    set autoindent
augroup END

augroup config
   au GuiEnter .profile,*rc      color solarized
   au GuiEnter .profile,*rc      set lines=60 | set columns=140
augroup END
Job
  • 43
  • 1
  • 5
  • Please post you .vimrc about the plugin – Windsooon Aug 31 '16 at 01:26
  • 1
    Syntastic's issue tracker is [that way](https://github.com/scrooloose/syntastic/issues). – romainl Aug 31 '16 at 07:36
  • 1
    @romainI The reason I didn't want to use the issue tracker is that I'm not sure if it's a syntastic issue or something on my end. – Job Aug 31 '16 at 16:59
  • @Aison Edited the post to include my vimrc. – Job Aug 31 '16 at 17:35
  • Do this https://github.com/scrooloose/syntastic/issues/824 solve your problem? – Windsooon Sep 01 '16 at 01:29
  • @Aison Unfortunately that does not solve my problem. It seems to be something with the makeprgBuild function. On startup (and on buffer switch) the function produces the full path to my current file but on write it does something else. It makes me think there's something up with the autocmd hooks. – Job Sep 01 '16 at 01:50
  • Yes, your `autocmd`s on `GuiEnter` don't make much sense and could (and probably should) be replaced by moving the corresponding commands to `after/ftplugin` files. But that has nothing to do with your problem. – Sato Katsura Sep 01 '16 at 06:53
  • Adding the following to my vimrc within the SetBVars function did the trick: `let b:syntastic_python_flake8_fname = expand("%:p"` Still not sure why the fname being passed is varying on write vs switching buffers. – Job Sep 01 '16 at 23:14

0 Answers0