A complete, production-quality vi editor clone implementation in Python.
- Full vi modal interface (normal, insert, visual, command modes)
 - All standard vi motions (h, j, k, l, w, b, e, 0, $, ^, G, gg, +, -, etc.)
 - Complete operator set (d, c, y, p, P, x, X, ~, J, etc.)
 - Visual mode (v, V) with operators
 - Text buffer management with undo/redo
 - File operations (open, save, quit)
 - Ex commands (:w, :q, :wq, :q!, etc.)
 - Terminal-based rendering
 - 100% passing torture test suite (120/120 tests)
 
# Install dependencies
uv sync
# The editor will be available in your virtual environmentpip install -e .# Using the installed command
vi filename.txt
# Or using Python module directly
python -m vi_editor.main filename.txt
# With uv
uv run python -m vi_editor.main filename.txti- Enter insert mode before cursora- Enter insert mode after cursorESC- Return to normal mode:w- Save file:q- Quit:wq- Save and quit:q!- Quit without savingh/j/k/l- Move cursor left/down/up/rightdd- Delete lineyy- Yank (copy) linep- Put (paste) after cursoru- Undov- Visual mode
The editor is structured in modular components:
- Core Engine: Buffer management, cursor handling
 - Command System: Modal interface, command parsing
 - User Interface: Terminal rendering, input processing
 - File Operations: File I/O, backup, recovery
 
pytest tests/This is a complete implementation following vi specifications, with no stubs or placeholders.