Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vim 在syntastic中启用SCON检查_Vim_Scons_Syntastic - Fatal编程技术网

Vim 在syntastic中启用SCON检查

Vim 在syntastic中启用SCON检查,vim,scons,syntastic,Vim,Scons,Syntastic,我想在vim+syntastic中激活对scons文件的检查 My.vimrc包括: au BufNewFile,BufRead SCons* set filetype=scons let g:syntastic_scons_checkers = ['flake8'] 打开scons文件和:SyntasticInfo Syntastic version: 3.6.0-86 (Vim 704, Linux) Info for filetype: scons

我想在vim+syntastic中激活对scons文件的检查

My.vimrc包括:

    au BufNewFile,BufRead SCons* set filetype=scons
    let g:syntastic_scons_checkers = ['flake8']
打开scons文件和:SyntasticInfo

    Syntastic version: 3.6.0-86 (Vim 704, Linux)
    Info for filetype: scons
    Global mode: active
    Filetype scons is active
    The current file will be checked automatically
    Available checkers: -
    Currently enabled checkers: -
这里没有列出检查人。我如何激活它


备注:flake8适用于python文件。

scons
文件类型作为
python
的别名:

let g:syntastic_filetype_map = { 'scons': 'python' }
编辑:同时添加此
autocmd

autocmd BufNewFile,BufRead SCons* let b:syntastic_checkers=['flake8']

我只是在加载时将SCons文件类型设置为python,其内容与您的类似。那对我来说就行了

" Display scons files with python syntax
autocmd BufReadPre,BufNewFile SConstruct set filetype=python
autocmd BufReadPre,BufNewFile SConscript set filetype=python
还有一点可能会让你挂断电话。。。如果在
.vimrc
中有这样一个代码片段

au BufWinLeave * silent! mkview
au BufWinEnter * silent! loadview

然后,您需要删除您试图打开的文件的视图文件,然后才能在文件打开时设置正确的文件类型。

这不是我要搜索的内容。我想为python和SCON激活不同的checker。然后,除了上面的集合
au BufNewFile,BufRead scons*让b:syntastic_checker=['flake8']
(或其他任何东西)。好的,这很有效,thanx!我觉得有点奇怪,g:syntastic\u scons\u checker有什么问题?问题是
g:
变量是全局的。总有一天你会想在同一个会话中编辑
scon
python
文件。我不明白你的意思。在我的设置中,我可以同时编辑这两种类型,因为它们的文件类型不同。我不明白为什么我可以对python文件使用
g:syntastic\u python\u checkers
,但不能对scons文件使用
g:syntastic\u scons\u checkers
。这并不是我真正要搜索的。我希望python和SCON有不同的检查程序(和语法)处于活动状态,因此我希望filetype=SCON。我不使用视图。