Sunday, June 14, 2015

pass vim variable to python script

So let's say I want the current line number in the Vim Buffer

let x=line(".")

And then I want to do something with it inside my Python script.
How do I refer to it? Or if there is a way to get the current line number using the python vim module? I see vim.current.line but this is a string of the line itself?


function! Script()

let x=line(".")

python << EOF

import vim

(how to refer to x?)


EOF

Thanks

Rick

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: