Firstly:

apt-get install vim-python

for Vi IMproved, with python scripting support hello.py:

import vim

count = 0

for b in vim.buffers:
     print "Length of buffer %s: %s" % (count, len(b))
     count = count + 1

vim.command("help python")

In vim:

:pyfile hello.py

Or you could just run command after command, like:

:python import vim

Er, check the docs

:help python
Feedback

Powered by Vanilla PHP feedback form