Skip to main content

A fast, modern, cross-platform modal text editor

Project description

Peovim

License: MIT Python 3.13+

A fast, modern, cross-platform modal text editor written in Python — heavily inspired by Neovim with a clean plugin API designed for extensibility.

I've been a Vim/Neovim editor Nerd for a long time and this project grew out of the question:

  • "Can a basic Vim/Neovim style modal editor be created entirely with Python?"

Achieving basic functionality was surprisingly straightforward, but then I immediately had these follow up questions:

  • Can I start adding all the plugins/features that I use in Neovim?
  • How slow will this be with this built using Python?

It turns out that most of the things that I wanted were relatively simple to add, especially with AI assistance. Additional features should be easy to add via the plugin API.

An optional Cython based renderer was added as a performance improvement.

Being written entirely in Python this editor is very easy to modify or create plugins for (especially with AI tools). If you are a modal editor nerd, fork this project and create your own hyper customized modal editor!.

Peovim demo

Features

  • Modal editing — Normal, Insert, Visual, and Visual Block modes with Vim-compatible bindings
  • LSP support — go to definition, hover, references, rename, code actions, completions, diagnostics, inlay hints
  • Syntax highlighting — tree-sitter powered, covering Python, JS/TS, Rust, Go, C/C++, Lua, and more
  • Side/Bottom Panels — file explorer, document outline, diagnostics, references, workspace symbols, git status
  • Git integration — status panel with staging/unstaging/discarding, branch management, diff view, log browser
  • Fuzzy finder — file picker, buffer picker, live grep, command palette
  • Session management — autosave/restore with per-project state
  • Flash jump — 2-char jump labels (s in normal mode)
  • Which-key — similar to Folke's key hint overlay Neovim plugin (my personal favorite Neovim plugin!)
  • Marker groups — persistent bookmarks with annotations and gutter signs
  • Local history — per-file timestamped save history
  • Copilot — support for Copilot autocompletions.
  • Plugin API — plain Python plugins with event hooks, keymaps, commands, decorations, and sidebar panels

Features more unique to my (Verilog, Python) workflow

  • Verilog LSP — a custom LSP that allows heirarchy collapse/extract, signal tracing, and more features using veriforge

Requirements

  • Python 3.13+
  • uv package manager

Installation

From source (development)

git clone https://github.com/chiplukes/peovim
cd peovim
uv sync
uvx pre-commit install   # activates lint/format hooks on every commit

As a global tool

uv tool install .

After install, the peovim command is available on your PATH:

peovim              # open empty buffer
peovim file.py      # open a file

Updating

Pull the latest changes, then reinstall:

git pull
uv tool install --reinstall .

Running (development)

uv run peovim           # open empty buffer
uv run peovim file.py   # open a file

Configuration

Create init.py at the platform config path:

Platform Path
Windows %APPDATA%\peovim\init.py
Linux ~/.config/peovim/init.py
macOS ~/Library/Application Support/peovim/init.py

The config file is plain Python. Example:

# init.py

plugins.load("peovim.plugins.lsp")
plugins.load("peovim.plugins.picker")
plugins.load("peovim.plugins.explorer")
plugins.load("peovim.plugins.outline")
plugins.load("peovim.plugins.gitsigns")
plugins.load("peovim.plugins.diagnostics_panel")
plugins.load("peovim.plugins.formatter")
plugins.load("peovim.plugins.local_history")

# Space as leader (default is backslash)
options.set("leader", " ")
options.set("number", True)
options.set("relativenumber", True)
options.set("tabstop", 4)

# Custom keybindings
keymap.nmap("<leader>w", ":w<CR>", desc="Save file")

Project-local config at .peovim/init.py is also supported — the editor prompts for trust on first encounter.

A more thorough init.py can be found here:

My Init.py

Key Bindings

Navigation

Key Action
<leader>ff Fuzzy find files
<leader>fg Live grep
<leader>fb Open buffers
<leader>sw Grep word under cursor
<C-o> / <C-i> Jump back / forward
gf Go to file under cursor
s Flash jump (type 2 chars)

LSP

Key Action
gd Go to definition
K Hover documentation
<leader>gr References sidebar
<leader>rn Rename symbol
<leader>ca Code actions
]d / [d Next / previous diagnostic
<leader>o Document outline sidebar
<leader>cD Diagnostics sidebar
<leader>csw Workspace symbols sidebar

Sidebar

Key Action
<leader>e Toggle file explorer
<leader>gs Toggle git panel
<A-h> Focus sidebar from editor
<A-l> Return to editor from sidebar
<A-j> / <A-k> Cycle sidebar panels
<Esc> Hide sidebar

Git Panel (when focused)

Key Action
a Stage file
u Unstage file
x Discard changes
d Diff file against HEAD
l Git log browser
P Push
p Pull

Editing

Key Action
gcc Toggle comment
ysiw{char} Surround inner word
cs{old}{new} Change surrounding
ds{char} Delete surrounding
<leader>pr Paste from yank register
ga (visual) Align on character

See notes/keys.md for the full key binding reference.

Ex Commands

Command Description
:w / :wq / :q Save / save+quit / quit
:e <file> Open file
:split / :vsplit Split window
:LspInfo / :LspRestart LSP status / restart
:format Format buffer
:colorscheme <name> Switch theme (catppuccin, gruvbox, onedark)
:Session / :SessionLoad Save / load session
:GitLog Open git log browser
:checkhealth Run health checks

Press <Tab> in the command line to fuzzy-browse all available commands.

Themes

Built-in themes: catppuccin (default), gruvbox, onedark.

Switch with :colorscheme <name> or set in init.py:

options.set("colorscheme", "gruvbox")

Development

# Install dev dependencies
uv sync --extra dev

# Run tests
uv run pytest tests/ --tb=no -q

# Lint / format
uv run ruff check peovim/
uv run ruff format peovim/

Optional: native Cython renderer

A Cython-accelerated renderer is included for a ~4–25× speedup on the render path. It builds automatically if a C compiler is present (cl.exe on Windows, gcc/clang on Linux/macOS). The pure-Python fallback is used otherwise — the editor runs fine either way.

# Verify which renderer is active
uv run python -c "from peovim._native import HAS_NATIVE; print(HAS_NATIVE)"

Documentation

Acknowledgments

I have spent an embarassing amount of time over the years "Configuring" Vim (and then Neovim). The plugin and editor developers are truly amazing and I strongly suggest spending time in that community to see all the creative and amazing things that are possible!

The following list was inspiration for this project:

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

peovim-0.1.4.tar.gz (893.1 kB view details)

Uploaded Source

Built Distribution

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

peovim-0.1.4-py3-none-any.whl (804.8 kB view details)

Uploaded Python 3

File details

Details for the file peovim-0.1.4.tar.gz.

File metadata

  • Download URL: peovim-0.1.4.tar.gz
  • Upload date:
  • Size: 893.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for peovim-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5c974b0bf10a7276b83a274f22e7a08ff07da3dd7ec7b8093139702bfdcdb793
MD5 80ec7adac73e48702370390c29708691
BLAKE2b-256 dd00dfdf00b988bc225f381f9ee9ef46b6bd84dded9cbafb5934bffa887f4c70

See more details on using hashes here.

Provenance

The following attestation bundles were made for peovim-0.1.4.tar.gz:

Publisher: publish.yml on chiplukes/peovim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file peovim-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: peovim-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 804.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for peovim-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bc7473618cfdf8e72f739d19784a42e7f32f6d204c010cf3c5d7931a0cb23826
MD5 8b689e45223d15d063157491f5fffe6f
BLAKE2b-256 75e58b67a1161601a5aa2786f151c0570bebbfe818926e823f321e02b72dc5b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for peovim-0.1.4-py3-none-any.whl:

Publisher: publish.yml on chiplukes/peovim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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