I currently have
autocmd BufRead *.sage
\ set filetype=python |
\ let b:syntastic_skip_checks=1
which works as intended (sage files are treated as Python, but with Syntastic disabled), and I would like to add BufNewFile (i.e. autocmd BufRead,BufNewFile) to it, but when I do, vim complains due to the b:syntastic_skip_checks buffer-local variable not yet existing at the time the BufNewFile event is triggered. Is there a way to either force Syntastic to load in that buffer before the autocmd executes, or to defer setting that variable until after the buffer is fully initialised?
Thanks!
let g:syntastic_ignore_files = ['\m\.sage$']. Add\cto make it case-insensitive (for Windows etc.). See:h 'syntastic_ignore_files'for further details. – lcd047 Jun 22 '16 at 15:18autocmd BufRead,BufNewFile *.sage set filetype=pythonandlet g:syntastic_ignore_files = ['\m\.sage$']– hugov Jun 22 '16 at 15:26