For example, processing positional arguments:
function! Example(arg)
python <<_EOF_
# do something with a:arg
_EOF_
endfunction
or the ... list:
function! Example(...)
python <<_EOF_
# do something with a:000, a:1, a:2, etc.
_EOF_
endfunction
Is there anyway I can do this?
You can retrieve the function arguments just like any other Vimscript expression through vim.eval()
:
function! Example(arg)
python << _EOF_
import vim
print "arg is " + vim.eval("a:arg")
_EOF_
endfunction
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With