Vimrunner
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.
Installation
There is a vimrunner package on PyPI, so you can install it with:
pip install vimrunner
Alternatively, you can just drop vimrunner.py file into your project - it is self-contained.
Testing
You can run unit tests using the command:
python setup.py test
Usage
import vimrunner
# initialize vim server
vim = vimrunner.Server()
# start GVIM as server and get a client connected to it
client = vim.start_gvim()
client.edit('any_file')
client.source('path/to/vim/plugin')
# 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 http://andri-ch.readthedocs.org/en/latest/
For any suggestions regarding the module and its documentation, please submit an issue using GitHub issue tracker
Metadata
Release files for vimrunner 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vimrunner-1.0.3.tar.gz | 11.2 kB | Without provenance | Details for vimrunner-1.0.3.tar.gz |
Release files / vimrunner-1.0.3.tar.gz
| Download URL | vimrunner-1.0.3.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30be7dad61daa40c80ab65a82c46a955a0c2da8f5e7d448b91da3c965f0f366e
|
|
BLAKE2b-256 checksum How to use checksums |
88c3efd8385f1e4279ba7d2f5b1827fec618b3dff8166aff1ac25c46145bbb29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for vimrunner 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.