{"id":8569,"library":"pyvim","title":"Pyvim","description":"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.","status":"active","version":"3.0.3","language":"python","source_language":"en","source_url":"https://github.com/jonathanslenders/pyvim","tags":["text editor","vim","cli","terminal","prompt_toolkit"],"install":[{"cmd":"pip install pyvim","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core terminal UI framework.","package":"prompt_toolkit"},{"reason":"Provides syntax highlighting functionality.","package":"Pygments"},{"reason":"Powers Python autocompletion (optional, for Python development).","package":"Jedi","optional":true},{"reason":"Enables Python code checking (optional, for Python development).","package":"Pyflakes","optional":true}],"imports":[{"note":"Pyvim is primarily a command-line application, not designed for direct library import of its editor functionality. Components are usually accessed via `prompt_toolkit`.","wrong":"from pyvim import Editor","symbol":"pyvim (executable)","correct":"Run 'pyvim' directly from the terminal or via subprocess"},{"note":"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.","wrong":"from pyVim import connect","symbol":"pyVim (case-sensitive)","correct":"pip install pyvim (for this library), pip install pyvmomi (for VMware SDK)"}],"quickstart":{"code":"import subprocess\nimport os\n\n# Create a dummy file for editing\nfile_content = \"Hello, pyvim!\\nThis is a test file.\\n\"\nwith open(\"example.txt\", \"w\") as f:\n    f.write(file_content)\n\nprint(\"Launching pyvim to edit example.txt. Press ESC, then :wq to save and exit.\")\n\ntry:\n    # Launch pyvim as a subprocess\n    # The input/output will be connected to the current terminal\n    subprocess.run([\"pyvim\", \"example.txt\"])\nexcept FileNotFoundError:\n    print(\"Error: 'pyvim' executable not found. Make sure it's installed and in your PATH.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n\n# Optionally, print the content after editing\nif os.path.exists(\"example.txt\"):\n    with open(\"example.txt\", \"r\") as f:\n        print(\"\\nContent of example.txt after editing:\")\n        print(f.read())\n","lang":"python","description":"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."},"warnings":[{"fix":"For very large files, consider disabling syntax highlighting or using native Vim/other editors optimized for large file performance.","message":"Performance can significantly degrade when editing large files (thousands of lines) with syntax highlighting enabled due to Python's string handling and Pygments processing.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Be aware of potential memory and performance limitations when working with exceptionally large documents.","message":"Pyvim'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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Test `pyvim` with your target Python 3 version to ensure full compatibility. The project's underlying `prompt_toolkit` generally supports modern Python versions.","message":"The 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.","severity":"gotcha","affected_versions":"Unclear for Python >3.4"},{"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.","message":"Lack of individual cursor support across split windows can lead to unexpected behavior where the cursor in one window affects other splits, including unintended scrolling.","severity":"breaking","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'2022':79 '3.0.3':47 'bind':41 'built':13 'cadenc':70 'capabl':56 'cli':83 'code':62 'complet':63 'current':44 'demonstr':51 'editor':12,81 'essenti':21 'featur':25 'highlight':29 'horizont':32 'implement':7 'includ':58 'integr':59 'irregular':72 'jedi':64 'key':40 'last':75 'librari':18 'like':24 'lint':66 'may':78 'offer':20 'page':37 'project':43 'prompt':16,53,85 'pure':5 'pyflak':67 'pygment':31 'python':6,61 'pyvim':1,2 'releas':69 'serv':48 'split':35 'syntax':28 'tab':36 'termin':84 'text':11,80 'toolkit':17,54,86 'updat':76 'upon':14 'version':46 'vertic':34 'vi':39 'via':30 'vim':10,23,82 'vim-lik':22","created_at":"2026-04-16T17:02:53.050610+00:00","updated_at":"2026-04-16T17:02:53.050610+00:00","problems":{"verify_error":"no import statement found"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"3.0.3","cli_name":"pyvim","cli_version":"Usage:","type":"library","homepage":null,"github":"https://github.com/jonathanslenders/pyvim","docs":null,"changelog":null,"pypi":"https://pypi.org/project/pyvim/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"skip","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-05","install_tag":null}}