sponsor Vim development Vim logo Vim Book Ad

VPE - Vim Python Extensions : Extension for Vim scripting using Python 3

 script karma  Rating 4/1, Downloaded by 1779  Comments, bugs, improvements  Vim wiki

created by
Paul Ollis
 
script type
utility
 
description
News

  VPE is now at version 0.7.0. The next version will be 1.0.

  VPE is no longer packaged as a Vim plugin. VPE is really a Python library and
  should now be installed in the same manner as other Python libraries; for
  example using ``pip``. Instructions are available at:

      https://vim-vpe.readthedocs.io/en/latest/installation.html

  I you are using version 0.6 or earlier, you should install it. See:

      https://vim-vpe.readthedocs.io/en/latest/installation.html#a-pre-0-7-version-of-vpe-in-installed

Requirements

  VPE requires a minimum of Vim 9 and Python 3.11

  VPE is tested on Linux and Windows.

Status

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

What it is all about

  Basically providing solid support for writing Vim extension code using Python.
  VPE effectively extends Vim's built in vim module (by providing a compatible
  replacement) to make access to Vim's functions, options, etc. easier and more
  Pythonic.

  In addition, the vpe package provides modules to make Python based plugin
  writing a far more practical proposition.

  The README at https://github.com/paul-ollis/vim-vpe.git gives more details and
  the online documentation at https://vim-vpe.readthedocs.io/en/latest provides
  a user guide and details of the API.

Source code

  The source code is maintained at https://github.com/paul-ollis/vim-vpe.git.
  You can raise bugs or feature requests there. Pull requests are also welcome.

See https://vim-vpe.readthedocs.io/en/latest/first-steps.html for how to get
started using VPE.
 
install details
Note that the download file is just a "stub" uploaded to trigger notification
of the latest version of VPE.

To install follow:

      https://vim-vpe.readthedocs.io/en/latest/installation.html
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vpe-stub-0.7.0.zip 0.7 2025-09-10 9.0 Paul Ollis The stepping stone to version 1.0
vim-vpe-0.6.zip 0.6 2021-09-14 8.0 Paul Ollis Version 0.6

- The main activity has been writing more of a user guide. The built-in Vim
  style help is now mainly reference. The full help is in HTML form - currently
  available at https://vim-vpe.readthedocs.io/en/userguide/.

- General

  - Fixed issue where VPE could fail to load its plugins.

  - Prevent some errors when getting application window information.

  - Reduce the likelyhood of callback failures passing silently.

  - The define_command function now allows the range argument to be True, which
    is equivalent to the Vim '-range' option without arguments.

  - The call_soon mechanism now logs a traceback upon failure.

- Refactoring

  - Cleaned up how single-shot timers are handled.

  - Moved a lot of code into vpe.common.

- AutoCmdGroup

  - Additional keyword arguments may now be passed to the function handling an
    event.

- Channel

  - The on_connect method is now invoked via call_soon.

  - The closed property was fixed to prevent an exception.

  - The on_message method is now invoked via call_soon.

  - Added a read method to allow explicit channel reading.

  - Prevent Vim error when closing an already closed channel.

- Popup windows

  - Better detection of mouse events, by adding hard coded sequences.

  - Made the textprop, textpropif and textpropwin properties read/write.

  - Tidied up handling of keys with modifiers.

  - The buffer property is now None where it would previously raise an
    exception.

  - Added setoptions and move methods.

- Buffer

  - Added an add_listener method. Provides a hook into Vim's listener_add
    mechanism. Treat this feature as quite experimental.

- ScratchBuffer

  - The init_options method now does nothing, it exists only to be
    over-ridden by subclasses.
vim-vpe-0.5.2.zip 0.5.2 2021-03-20 8.0 Paul Ollis Version 0.5.2

- Big change to colors.py. Should not affect the existing API.

- Better window size behaviour when displaying ScratchBuffers.

- Fix invalid characters in generated autogrp names.

- Add support for VPE plugin help files.

- Better preserve types for option access.
vim-vpe-0.5.1.zip 0.5.1 2021-03-12 8.0 Paul Ollis Version 0.5.1

- Added a load of missing API documentation that I foolishly forgot about.

- The temp_active_buffer context manager now also preserves the window's
  view.
vim-vpe-0.5.zip 0.5 2021-03-09 8.0 Paul Ollis Version 0.5

- Try to prevent VPE's help obscuring help for standard Vim commands and
  functions.

- Added plugin system; I find this easier to use for Python based plug-ins.

- Key mappings, user commands and auto commands now show the Python function
  name.

- Allow key mappings and user commands that do not pass an info object.

- Support creating key mappings that simply expand as strings; for when a Python
  fucnction is overkill.

- All commands available via vpe.commands now get prefixed with 'keepalt' by
  default. This is a backwardly incompatible change, but should have minimal
  impact on existing code.

- New modules.

  - vpe.windows. Provides a wrapping around the output of winlayout().

  - vpe.app_ui_support. Provides a way to query information about Vim's
    application window when runninf on an X-desktop.

  - vpe.config. Provides a mechanism defined configuration values which can
    stored on disk.

  - vpe.panels. Provides an extension to ScratchBuffer that horizontally
    divides the buffer into one or more independent panels.

  - vpe.ui. Adds user interaction support, building on vpe.panels. Currently
    it is focussed on supporting interactive modification of values managed by
    vpe.config.

- New and modified functions.

  - Added 'soon' argument to error_msg.

  - Added echo_msg and warning_msg (to match error_msg).

  - Added temp_active_window context manager.

  - Added saved_current_window and temp_active_buffer context managers.

- New classes

  - CommandHandler, EventHandler, BufEventHandler and KeyHandler. These support
    using Python decorators as a clean way to map user commands, event and key
    sequences to Python methods.

- Buffer class

  - Enhanced the show method to allow vertical splits and provide more
    flexibility in how line/columns are allocated to each half of the split.

  - Added a split_and_show method.

  - Added is_active method. Return True if the buffer is showing in the current
    window.

  - Methods find_active_windows and goto_active_window now only search the
    current tab page by default. This is backwardly incompatible. Also added
    find_best_active_window.

- TemporaryOptions class

  - Added a save method.

- Syntax class

  - Can be used without clearing previous syntax items.

- Window class

  - Added a close method.

- Vim class

  - Added iter_all_windows method.

- Syntax class

  - It is not possible to prevent automatic deletion of old syntax.

- ScratchBuffer class

  - New method on_first_showing is invoked when the buffer is first shown. This
    is intended to be over-ridden or extended.

  - Added auto_grp_name and syntax_prefix properties. These are useful to avoid
    name clashes when adding syntax and auto commands.

- Added support for vertical, aboveleft, belowright, topleft, botright and
  keepalt modifiers for vpe.commands.

- Provide mechanism to reset a Vim option to its default value.

- Work around an issue where Vim can consume large amounts of memory due to
  code executed by timer. This could only occur when a Vim session was left
  without focus.
vim-vpe-0.4.1.zip 0.4.1 2020-11-23 8.0 Paul Ollis - Log class.
  - Changed the way the buffer contents are trimmed. Prevents (or at least
    reduces) annoying window redraws/corruption.
vim-vpe-0.4.zip 0.4 2020-11-21 8.0 Paul Ollis - Works on Windows (10).
- General
  - Added dot_vim_dir function.
  - List style options are now always converted
    from bytes to str.
- Buffer class
  - Added find_active_windows method.
  - The ScratchBuffer can now be usefully sub-classed.
  - Added set_ext_name method.
- Windows class.
  - Added visible_line_range property.
- Timers
  - Fixed bug for single shot timers.
vim-vpe-0.3.zip 0.3 2020-11-06 8.0 Paul Ollis - Fixed issue with examples running 'out-of-the-box'.
- Added a version() function to the vpe module.
- Added define_command function.
  - User commands that call Python.
- Timers
  - Added fire_count attribute.
  - Added dead attribute.
  - Fixed timer clean up.
- Fix to error_msg to restore message colour.
- Add Syntax.include method.
vim-vpe-0.2.zip 0.2 2020-10-27 8.0 Paul Ollis Documentation improvements (still needs work).
Some internal code refactoring.
Improved logging of run-time errors (to log buffer).
Syntax class:
  - Added link_to argument to group method.
ScratchBuffer:
  - Prevent annoying warning message.
Buffer class:
  - Added new properties: type, location, long_display_name,
    short_display_name, short_description, bufnr, changed, changedtick,
    lastused, lnum, linecount, loaded, variables, windows and popups.
  - Added goto_active_window method.
Started adding some examples as a supplement to the documentation.
The HTML help is now available on readthdocs.
vim-vpe.zip 0.1 2020-10-02 8.0 Paul Ollis Initial upload
ip used for rating: 216.73.216.138

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github