Registry / http-networking / pyvim
library3.0.3pypypiunverified

Pyvim is a pure Python implementation of the Vim text editor, built upon the `prompt_toolkit` library. It offers essential Vim-like features such as syntax highlighting (via Pygments), horizontal and vertical splits, tab pages, and Vi key bindings. The project, currently at version 3.0.3, serves as a demonstration of `prompt_toolkit`'s capabilities and includes integrations for Python code completion (Jedi) and linting (Pyflakes). Its release cadence is irregular, with the last update in May 2022.

pip install pyvim
INSTALL
IMPORT
SIG · PYVIM
P
pyvim
http-networkingpythonv3.0.3
Install
3.7s avg
Import
Disk
35MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 39.3MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.7s · import 0.000s · 40MB
35MB installed
● package 35MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pyvim (executable)
Run 'pyvim' directly from the terminal or via subprocess
from pyvim import Editor
Pyvim is primarily a command-line application, not designed for direct library import of its editor functionality. Components are usually accessed via `prompt_toolkit`.
pyVim (case-sensitive)
pip install pyvim (for this library), pip install pyvmomi (for VMware SDK)
from pyVim import connect
Common `ModuleNotFoundError` due to confusion with the unrelated `pyVim` module which is part of the `pyvmomi` (VMware vSphere SDK) library and uses a capital 'V'. 'pyvim' (lowercase 'v') is a distinct project.

This quickstart demonstrates how to programmatically launch the `pyvim` editor using Python's `subprocess` module. It creates a temporary file, opens it in `pyvim`, and then displays the file's content after the editor is closed. Users interact with `pyvim` directly in their terminal.

import subprocess import os # Create a dummy file for editing file_content = "Hello, pyvim!\nThis is a test file.\n" with open("example.txt", "w") as f: f.write(file_content) print("Launching pyvim to edit example.txt. Press ESC, then :wq to save and exit.") try: # Launch pyvim as a subprocess # The input/output will be connected to the current terminal subprocess.run(["pyvim", "example.txt"]) except FileNotFoundError: print("Error: 'pyvim' executable not found. Make sure it's installed and in your PATH.") except Exception as e: print(f"An error occurred: {e}") # Optionally, print the content after editing if os.path.exists("example.txt"): with open("example.txt", "r") as f: print("\nContent of example.txt after editing:") print(f.read())
pyvim --version
Debug
Known issues
gotchaPerformance can significantly degrade when editing large files (thousands of lines) with syntax highlighting enabled due to Python's string handling and Pygments processing.
fix
For very large files, consider disabling syntax highlighting or using native Vim/other editors optimized for large file performance.
affects: All versions
gotchaPyvim's buffer implementation uses simple Python strings, which can be inefficient for extremely large files and may not scale as well as optimized text editor data structures.
fix
Be aware of potential memory and performance limitations when working with exceptionally large documents.
affects: All versions
gotchaThe documentation on GitHub states compatibility up to Python 3.4. While PyPI's `requires_python` is empty (implying broader Python 3 support), explicit modern Python 3 compatibility (e.g., 3.9+) is not clearly documented by the project author.
fix
Test `pyvim` with your target Python 3 version to ensure full compatibility. The project's underlying `prompt_toolkit` generally supports modern Python versions.
affects: Unclear for Python >3.4
breakingLack of individual cursor support across split windows can lead to unexpected behavior where the cursor in one window affects other splits, including unintended scrolling.
fix
This is a known limitation of the `prompt_toolkit` library that `pyvim` is built upon and may not have a direct workaround within `pyvim` itself. Be mindful of this behavior when using split views.
affects: All versions
Upgrade
Version history
3.0.3latest on PyPI · released May 16, 2022
Audit
Dependencies
prompt_toolkitrequiredCore terminal UI framework.
PygmentsrequiredProvides syntax highlighting functionality.
JedioptionalPowers Python autocompletion (optional, for Python development).
PyflakesoptionalEnables Python code checking (optional, for Python development).
Agent activity
19 hits · last 30 days
node
14
Resources
pyvim — pip install pyvim · libregistry