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
Post a Comment