TWrite is a fast, modular text editor crate for Rust. Leveraging the GPU-accelerated GPUI framework developed by Zed, it provides a responsive, extensible base for building modern text, Markdown, and custom-language editors
Full guides plus the API reference live at https://toonionofficial.github.io/twrite/docs.
Install
[]
= "0.2"
= "0.9"
# Optional batteries and backends:
# twrite = { version = "0.9", features = ["markdown"] }
# gpui = { version = "0.2", default-features = false, features = ["wayland"] }
# twrite = { version = "0.9", default-features = false, features = ["wayland"] }
Linux also needs GPUI system libraries; see the full setup.
Usage
use ;
let editor = cx.new;
cx is your GPUI window context; examples/simple.rs shows the complete
shell around this fragment.
Getting started
Run the examples in order; each builds on the previous one:
The pattern everywhere is the same: Editor owns the buffer, hooks
(EditorHook + HookContext) own behavior, and batteries bundle the two.
Start from examples/simple.rs and follow the Next: pointers.
Links
- Documentation (guides plus API reference)
- Changelog
- License