pip install blessed && python vs_cli.py .
— that's it.
▸ Editor preview
1▌ import os, sys, re 2 import subprocess 3 from pathlib import Path 4 from collections import deque 5 6▌ # undo stack — snapshot before every destructive op 7 _UNDO_LIMIT = 500 8 9 class EditorState: 10 def __init__(self): 11 self.lines = [''] 12 self.cy = self.cx = 0
vs-cli is a single Python file (~700 lines) that gives you a VS Code-flavored editing experience
in any terminal. File explorer, git gutter, syntax highlighting, undo/redo, bracket matching, integrated terminal,
command palette, quick-open, global grep, outline view, zen mode — the works.
It runs anywhere Python 3.10+ runs, with one pip install.
▸ Installation
$ pip install blessed
$ python vs_cli.py [file or directory]
Requires Python 3.10+. No other dependencies. Works on Linux, macOS, and over SSH. Download: vs-cli.py
▸ Features
- [+] Syntax highlighting — Python, JS/TS, JSON, Markdown
- [+] Undo / redo (Ctrl+Z / Ctrl+Y) — 500-entry snapshot stack
- [+] Bracket auto-close and visual bracket matching
- [+] Auto-indent detection — tabs vs spaces, width detection
- [+] Smart newline with auto-indent after
:and{ - [+] Git gutter — added / modified / deleted indicators per line
- [+] Quick open (Ctrl+P) — fuzzy file search across project
- [+] Global grep (Ctrl+F) — project-wide search via
grep -rn - [+] Find & replace (Alt+R) — replace-all with undo
- [+] Outline view (Ctrl+O) — functions and classes for py/js/ts
- [+] Sticky scroll — enclosing function pinned to top of viewport
- [+] Zen mode (F11) — hides sidebar and status bar
- [+] Integrated terminal panel (F9→A) — run commands inline
- [+] Command palette (Shift+F6) — searchable command list
- [+] File explorer with expand/collapse and parent navigation
- [+] Word jump (Ctrl+← / Ctrl+→)
- [+] Smart home key — toggle between indent and column 0
- [+] Flicker-free full-screen rendering via single write()
- [+] Color auto-detection — gracefully disables on unsupported terms
- [ ] Multiple buffers / tabs — not yet
- [ ] LSP / autocomplete — not planned
- [ ] Plugin system — not planned
▸ Keybindings
| Key | Action | Context |
|---|---|---|
| Ctrl+S | Save file | global |
| Ctrl+Q | Quit | global |
| Ctrl+Z | Undo | global |
| Ctrl+Y | Redo | global |
| F5 | Focus explorer | global |
| F6 | Focus editor | global |
| Shift+F6 | Command palette | global |
| F11 | Toggle zen mode | global |
| F9 → A | Open terminal panel | global |
| F9 → C | Close terminal panel | global |
| Ctrl+P | Quick open file | global |
| Ctrl+F | Global grep | global |
| Ctrl+O | Outline / symbols | global |
| Alt+S | Search in file | global |
| Alt+W | Go to folder | global |
| Alt+R | Find and replace | global |
| Ctrl+← / → | Word jump | editor |
| Home | Smart home (indent ↔ col 0) | editor |
| End | End of line | editor |
| PgUp / PgDn | Scroll by page | editor |
| Tab | Indent (auto-detected) | editor |
| Enter | Newline + smart indent | editor |
| Backspace | Delete char / bracket pair | editor |
| ↑ ↓ Enter | Navigate / open | explorer |
| Backspace | Parent directory | explorer |
| Esc | Focus editor | terminal |
▸ Design notes
The entire screen is redrawn every frame as a single sys.stdout.write() call.
No diff, no partial updates. At 20fps this costs under 2ms per frame — the simplicity is worth it.
The undo stack stores full line snapshots in a deque(maxlen=500).
Snapshots are deduplicated to avoid filling the stack during held-key repetition.
The terminal panel is not a PTY. It uses blocking subprocess.run().
Interactive programs like vim, htop, or the Python REPL
will not work. This is a deliberate tradeoff for zero complexity.