snip is a Nix-first terminal editor for people who want everything essential in one place: fast editing, clean architecture, and zero feature bloat.
snip includes the pieces you actually need to ship and use a serious terminal editor:
- Yoinks LSPs from your Nix shell, eliminating need for plugins
- Highly performant and concurrent event-driven app loop for predictable behavior
- Typed message/update pipeline for explicit state transitions and easy testing
- Non-blocking (deferred) command execution via background workers
- Terminal input + rendering split into clean runtime/UI boundaries for system-agnostic operation
nix buildRun all checks:
nix flake checkcmake -S . -B build
cmake --build build -j
./build/snipThe project is split into focused modules with strict responsibilities.
Concurrency and scheduling primitives:
- event loop
- event sources
- signaling pipe
- concurrent queue
- thread pool
Runtime integration layer:
- input decoding
- command execution and orchestration
Filesystem integration layer:
- stateless file read/write helpers
- line-range extraction utilities
Terminal integration layer:
- terminal session lifecycle
- terminal sizing/output utilities
Editor domain layer:
- editor state/model
- operations and update logic
- message handling
- UI-agnostic view model generation
Rendering backend layer:
- ViewModel to Frame IR rendering
- styling and formatting helpers
- Frame to ANSI translation
This keeps editor behavior independent from terminal backend details and makes backend evolution straightforward.
Take care to adhere to the following rules when adding new functionality to snip:
- Each new library should have a short
README.mddetailing the responsibilities thereof. - Try to include a short comment before each function.
- Each class should have a brief and simple explanation of what it does at the top-level.
- Expand modal editing semantics toward complete workflows
- Add richer navigation, search, and picker workflows
- Add language-aware capabilities (highlighting, structure, diagnostics)
- Improve rendering performance and terminal capability detection
- Keep plugin surfaces extensible while protecting core simplicity