Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Interface for controlling a Vim editor using Python code.

Project description


Module that implements a client and server interface useful for controlling a Vim editor, started as a server, programmatically. This module could be used for unit testing or integration testing for a Vim plugin written in Python. Or you can use it to interactively control a Vim editor by python code, for example, in an Ipython session.

How it all started

I created a class that used the vim python module to emulate a vim buffer and that would act like a list, so you could read and write lines and manipulate text using python.

However, I stumbled across Vimrunner which is a Ruby gem used to “spawn a Vim instance and control it programatically.”

So, this python module is heavily inspired by the project mentioned above.


There is a vimrunner package on PyPI, so you can install it with:

pip install vimrunner

Alternatively, you can just drop file into your project - it is self-contained.


You can run unit tests using the command:

python test


import vimrunner

# initialize vim server
vim = vimrunner.Server()

# start GVIM as server and get a client connected to it
client = vim.start_gvim()

# start Vim editor in a terminal; it should work for Debian, Ubuntu, etc.
# that have a desktop installed
client = vim.start_in_other_terminal()

Documentation is available at

For any suggestions regarding the module and its documentation, please submit an issue using GitHub issue tracker

Project details

Release history Release notifications

This version
History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
vimrunner-1.0.3.tar.gz (11.2 kB) Copy SHA256 hash SHA256 Source None Nov 24, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page