Skip to main content

programmable Vim, no need of +clientserver!

Project description

Travis CI Coveralls Code Climate PyPI Version Python Versions

Introduction

headlessvim makes Vim programmable to support developping Vim plugins.

The most distinctive characteristic is, headlessvim NEVER needs +clientserver feature.

Install

Using pip (recommended)

pip install headlessvim

The good old setup.py

python setup.py install

Usage

A simple example is here:

>>> import headlessvim
>>> with headlessvim.open() as vim:
...    vim.echo('"spam"') # make sure to quote bare words
...
'spam'
>>> import os
>>> env = dict(os.environ, LANG='C')
>>> with headlessvim.open(executable='/usr/bin/vim', args='-N -u /etc/vim/vimrc', env=env):
...    vim.send_keys('iham\033')
...    vim.display_lines()[0].strip()
...
'ham'

Integrating to unittest:

import unittest
import headlessvim

class TestVimPlugin(unittest.TestCase):
    def setUp(self):
        self.vim = headlessvim.open()

    def tearDown(self):
        self.vim.close()

    def testSomeFeature(self):
        res = self.vim.echo('"ham egg"')
        self.assertEqual(res, 'ham egg')

Documentation

See the online document for more information.

Testing

Execute:

python setup.py test

License

The MIT License.

See LICENSE.txt for more information.

Project details


Download files

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

Source Distribution

headlessvim-0.0.5.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

headlessvim-0.0.5-py2-none-any.whl (10.2 kB view details)

Uploaded Python 2

File details

Details for the file headlessvim-0.0.5.tar.gz.

File metadata

  • Download URL: headlessvim-0.0.5.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for headlessvim-0.0.5.tar.gz
Algorithm Hash digest
SHA256 f6b75fc13316fb4c9d937e32e6e8e8bbf843ad1dcb264ef4d276b8a6aad84c2f
MD5 29ebc12132c214b25fbe56b45bafcc45
BLAKE2b-256 7a06e56fe00862dd07a13bb459002883566acb2ff255bcd6543b64717fb2c97a

See more details on using hashes here.

File details

Details for the file headlessvim-0.0.5-py2-none-any.whl.

File metadata

File hashes

Hashes for headlessvim-0.0.5-py2-none-any.whl
Algorithm Hash digest
SHA256 4bc4efd6a7cc8d23df80d94e855b1e99b47ee87ecfe81485c63ca6fd29461b4f
MD5 bc94225d3acd4cc1171d4bf0e0971aa5
BLAKE2b-256 c2a6627d8e1a2672643807fff554410fb6c403637845e9874ef401e1f0ac65df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page