Skip to main content

The Vim Python Extensions (VPE)

Project description

 _    ______  ______
| |  / / __ \/ ____/
| | / / /_/ / __/     The Vim Python Extensions
| |/ / ____/ /___
|___/_/   /_____/

Welcome to the Vim Python Extensions (VPE).

status:

This is version 0.7.3.

The Version 0.7 line is intended to be the stepping stone for version 1.0.

Although it has not yet reached a version 1.0 release, I make heavy, daily use of VPE within my Vim environment without problems.

While the API should be considered unstable, it has actually proven largely stable, with only a few, minor incompatible changes since version 0.1.

Introduction

VPE provides a toolkit of modules and classes aimed at making it easier to extend Vim using modern Pythonic code. The headline features are:

  • Instead of using the standard vim module you can use the vpe.vim object, which provides a greatly extended superset of the vim module’s features.

  • Other extensions that, along with vpe.vim, just make it easier to write Pythonic plugin code for Vim.

Installation

Read the installation instructions online.

Using VPE

This is just a brief introduction. For more complete documentation see the online documentation.

The quickest way to start using VPE is to import the vim object:

from vpe import vim

The vim object is an instance of the Vim class, which is designed as a drop in replacement for Vim’s standard python-vim module, but with a number of enhancements, including:

  • Most of Vim’s functions appear as members, for example:

    vim.cursor(4, 10)            # Position cursor at row 4, column 10.
    m = vim.execute('messages')  # Get all the recent Vim messages.
  • The attributes buffers, current, options, tabpages, vars, vvars and windows provide enhanced access to the corresponding Vim objects. For example vim.current.buffer provides a Buffer instance in place of Vim’s standard python-buffer. This supports things like easier access to buffer variables, more efficient buffer modification and per-buffer metadata storage.

  • The Vim registers are available using the registers attribute.

  • When errors occur a VimError is raised, which provides a better breakdown of the error (code and command are available as attributes). This is a subclass of vim.error so existing code that catches vim.error still works.

Features

This is a brief list of VPE’s features.

  • The vpe.vim object - a much enhanced replacement for the standard vim module (python-vim). This is an instance of the Vim class.

  • Classes Window, Buffer, TabPage are enhanced wrappers around the standard (vim) versions.

  • Key mappings can cleanly be set up to invoke Python functions and methods.

  • User commands can cleanly be set up to invoke Python functions and methods. VPE also provides support for subcommands and automatic command line tab-key completion.

  • Timers can cleanly be set up to invoke Python functions and methods.

  • Autocmd Events can cleanly be set up to invoke Python functions and methods.

  • A built in log, which is useful for debugging plugin code.

    • The log can be displayed in a dedicated Vim buffer.

    • Printing can be redirected to the log.

    • You can create your own plugin specific log(s).

  • Pythonic support for using popup windows.

  • Pythonic support for channels.

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

vpe-0.7.3.tar.gz (228.6 kB view details)

Uploaded Source

Built Distribution

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

vpe-0.7.3-py3-none-any.whl (189.7 kB view details)

Uploaded Python 3

File details

Details for the file vpe-0.7.3.tar.gz.

File metadata

  • Download URL: vpe-0.7.3.tar.gz
  • Upload date:
  • Size: 228.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for vpe-0.7.3.tar.gz
Algorithm Hash digest
SHA256 473f1daaea87b41653c0fcd52ba8433bc437a824c44cd40e6fdd4e69a2c3cf99
MD5 5bd35c127f2d643af554cea1583aa6ed
BLAKE2b-256 69a0205d79152c433573c651c9e8b9c9b3661705ab73898e7584bcc3f6351d24

See more details on using hashes here.

File details

Details for the file vpe-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: vpe-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 189.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.3

File hashes

Hashes for vpe-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ea15b55798e76545c1554d89b69756a399448a2dc76b5785e0670044275ec94a
MD5 b8f22845c9cbffb9a601eeb36452d934
BLAKE2b-256 1e6e57d5535cb4d8069a2050e072b40b32033b51a2afeb2ec3f35ec5f6454a8e

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