例如,处理位置参数:
function! Example(arg)
python <<_EOF_
# do something with a:arg
_EOF_
endfunction
Run Code Online (Sandbox Code Playgroud)
或...列表:
function! Example(...)
python <<_EOF_
# do something with a:000, a:1, a:2, etc.
_EOF_
endfunction
Run Code Online (Sandbox Code Playgroud)
无论如何我能做到吗?
Ing*_*kat 16
您可以像通过vim.eval()
以下任何其他Vimscript表达式一样检索函数参数:
function! Example(arg)
python << _EOF_
import vim
print "arg is " + vim.eval("a:arg")
_EOF_
endfunction
Run Code Online (Sandbox Code Playgroud)