DZed is an experimental terminal text editor inspired by Zed's editing architecture and Vim's modal editing model.
The goal is not to reproduce either editor exactly. DZed explores what a fast, compact, Vim-oriented terminal editor can look like when built on top of Zed's core text infrastructure, including its rope, CRDT buffer, anchors, sum trees, and incremental display mapping.
DZed is currently a proof of concept and an active learning project rather than a production-ready editor.
- Bring Zed's high-performance text and buffer primitives to a terminal interface.
- Build a Vim-inspired modal editing experience without depending on Vim itself.
- Experiment with selections, multiple cursors, text objects, display maps, and asynchronous editor services.
- Keep the codebase small enough to understand, modify, and use as a platform for editor experiments.
- Gradually improve Vim compatibility while retaining the flexibility to adopt ideas from Zed and other modern editors.
- CRDT-backed text buffers and stable anchors.
- Rope-based text storage and editing.
- Sum-tree indexing through Zed's core crates.
- Incremental buffer snapshots used by rendering, wrapping, and highlighting.
- Multiple open buffers with buffer switching.
- Normal, Insert, Command, Visual, Visual Line, and Visual Block modes.
- Vim-style motions across characters, words, lines, paragraphs, and documents.
- Motion counts and composed operator-motion commands.
- Character search motions and repeatable multi-key command sequences.
- Insert, append, open-line, change, delete, undo, and redo operations.
- Mode-aware cursor behavior and selection extension.
- Macro recording (
q{c}to record to register{c},qto stop recording) and replaying (@{c}with support for count prefix to repeat execution).
- Characterwise, linewise, and blockwise visual selections.
- Selection synchronization for Visual Line and Visual Block modes.
- Word-based text objects, including inside and around selections.
- Motion-based delete, change, and yank operations.
- Multiple cursors and selection of similar text occurrences.
- Orientation-independent selection range handling.
- Text extraction from individual selections and combined multi-selections.
- Internal editor clipboard owned by the
Editor. - Characterwise, linewise, and blockwise clipboard metadata.
- Motion-based and linewise yank support.
- Characterwise and linewise paste behavior.
- Paste counts and cursor restoration after yank operations.
- Named register support (
"{register}yto yank to register,"{register}pto paste).
- Terminal interface built with
crossterm. - Soft wrapping through custom
WrapMapandDisplayMaplayers. - Logical buffer-point to display-point conversion.
- Scrolling that follows the active cursor.
- Optional line-number gutter.
- Syntax highlighting powered by
syntectand AST-based syntax folding/parsing usingtree-sitter(supporting Rust, Go, Python, HTML, Markdown, etc.). - Search-match and selection highlighting.
- Dedicated buffer, status-bar, command-line, and cursor renderers.
- Mode-specific terminal cursor styles.
- Block code folding.
- Bracketed paste and mouse-capture support.
- Plain-text and regular-expression search.
- Forward and backward match navigation.
- Search and command history.
- Bounded cross-row match searches used by multi-cursor selection.
- Basic command-line operations for buffers, themes, wrapping, syntax highlighting, line numbers, and line navigation.
- Asynchronous syntax-highlighting tasks.
- Asynchronous wrapping tasks.
- Asynchronous tree-sitter tasks.
- Task identifiers prevent stale background results from replacing newer editor state.
- Key-event handling is separated from keymap definitions.
- Normal, Insert, and pending multi-key command maps are represented independently.
- Runtime key-binding APIs provide a foundation for future configurable keymaps.
- Actions are resolved separately from document mutation and rendering.
cargo build -p test_zedcargo run -p test_zed -- <path-to-file>Multiple paths may be supplied to open more than one buffer.
cargo test -p test_zedDZed is under active development. Editing behavior, internal APIs, and file organization may change frequently. Important areas still being developed include broader Vim parity, richer text objects, complete clipboard semantics, persistence and save commands, configurable keymaps, and more robust terminal interaction.
This project has been built largely through AI-assisted development using Gemini and GPT models. I wrote the initial prototype while studying Zed's core components—particularly its sum tree, rope, text, and editor implementations. AI has since become an integral part of implementation, refactoring, debugging, and experimentation.
Contributions are welcome, especially those that improve Vim-style editing, deepen integration with Zed's crates, add tests for editor behavior, or simplify the architecture without hiding how it works.
If you find the project useful and would like to support continued development, contributions help cover development and AI-assisted tooling costs.



