Friday, June 13, 2014

use python script in vim

Hi,

I am trying to write a vimscript that uses python, but cant interface it properly.

A minimal example is:

function! Usrnm(nm)
python << endpython
import vim
import os
nm=vim.eval(os.getlogin())
endpython
echo nm
endfunction

call IMAP ('`foo', "@nm \<CR> Usrnm(nm)", "fortran")

Can anyone please help me achiving this? i.e. getting the login name to be used in the IMAP call?

--
--
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:

Post a Comment