How to print the output of python code in Vim buffer? -


example (in vim function):

python3 << endpython import vim,sys,locale locale.setlocale(locale.lc_all, vim.eval("locale")) in range(1,10,2):     print(locale.format('%.2f', i)) endpython 

the print command, prints numbers echo message.
print numbers @ top of current buffer.
how can this?

you can access current buffer , append after line 0 (= inserting @ top) via:

vim.current.buffer.append("example text", 0) 

see :help python-buffer.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -