例如,处理位置参数:
function! Example(arg)
python <<_EOF_
# do something with a:arg
_EOF_
endfunction
或......列表:
function! Example(...)
python <<_EOF_
# do something with a:000, a:1, a:2, etc.
_EOF_
endfunction
无论如何我能做到吗?
答案 0 :(得分:14)
您可以通过vim.eval()
:
function! Example(arg)
python << _EOF_
import vim
print "arg is " + vim.eval("a:arg")
_EOF_
endfunction