我想要在Python语法检查器中更改设置或编辑一行代码,但Syntastic提供了五个选项。如何找出当前使用的选项?
Syntastic已经内置了这个功能。我相信可用的语法检查器取决于你的系统。
:SyntasticInfo
Syntastic info for filetype: python
Available checkers: python
Currently active checker(s): python
Press ENTER or type command to continue
:redir
命令:function! s:syntastic_checkers(...)
redir => output
silent SyntasticInfo
redir END
let result=split(output, "\n")
let checkers=split(split(result[-2], ':')[-1], '\s\+')
if checkers[0]=='-'
let checkers=[]
else
call extend(checkers, split(split(result[-1], ':')[-1], '\s\+')[:1])
endif
if a:0 "just echo the result
echo 'Checkers: '.join(checkers, ', ')
else
return checkers
endif
endfunction
command! SyntasticCheckers
使用任何参数调用它以打印检查器列表,不带任何参数调用它以返回vim检查器列表,加上列表中最后一个位置的当前检查器。