TWrite Documentation
TWrite is a fast, modular text editor engine for Rust, built on the GPU-accelerated GPUI framework. It provides an extensible foundation for building everything from simple single-line inputs to full-featured Markdown note-taking tools and modal code editors.
Highlights
- GPU Acceleration: Fluid 60+ FPS text rendering and smooth scrolling powered by GPUI.
- Rope Buffer Engine: Backed by
ropeyfor fast inserts, deletes, and multi-megabyte document handling with transaction-based undo/redo. - Extensible Hook Architecture: Custom keybindings, auto-pairs, status indicators, and modal editing via pure-Rust hooks with zero GPUI boilerplate.
- Batteries-Included Markdown: Live syntax highlighting, concealed formatting (
Dimmed,Hidden,Off), interactive task checkboxes, tables, and hyperlinks. - Interactive Find & Replace: Built-in search engine with regex support, whole-word and case toggles, caret steppers, and single-undo replace all.
- Command Palettes & Prompts: Headless prompt engine for floating
F1palettes,:goto-linebottom bars, and fuzzy-filtered item lists. - Multi-Click Selection: Word double-click, line triple-click, and boundary-snapping drag selection.
Where to Start
- Getting Started: Add
twriteto yourCargo.tomland launch your first editor window in under 35 lines of code. - Recipes:
- Simple Text Editor: Basic editor setup, configuration, and buffer operations.
- Markdown Note Editor: Enable Markdown formatting, task lists, and conceal modes.
- Find & Replace: Wire up the built-in search toolbar.
- Custom Hooks & Shortcuts: Intercept keys, track edits, and add status bars.
- Command Palettes & Prompts: Build floating palettes and command bars.
- Modal & Vim Editing: Build modal editors with hooks alone.
- Reference:
- Configuration Reference: Full options table for
EditorConfig. - API Reference: Links to rustdoc API reference.
- Changelog: Release history and notes.
- Configuration Reference: Full options table for