Answers:
这是您的完成方式。
定义一个确定python3是否可用的函数:
function! s:UsingPython3()
if has('python3')
return 1
endif
return 0
endfunction
然后获取正确的python命令:
let s:using_python3 = s:UsingPython3()
let s:python_until_eof = s:using_python3 ? "python3 << EOF" : "python << EOF"
let s:python_command = s:using_python3 ? "py3 " : "py "