Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Zed 9 min read Case study mediumAdept

Why not just embed Neovim?

Zed implements its own Vim mode on top of its native editor foundations instead of embedding Neovim, because embedding would mean discarding or duplicating Zed's rope, SumTree, CRDT-based collaboration, render pipeline and async runtime. Differences such as Vim addressing characters while Zed addresses the gaps between them make exact Vim emulation tricky, especially around newlines, counts, and what the `.` command repeats. Building on Zed's core lets Vim motions combine with multi-cursors, Treesitter node selection, diagnostics and the command palette. Neovim still has a role: tests in the `vim` crate run a headless Neovim to generate golden files that Zed's Vim mode is checked against.

Assumes: Vim motions and operators

Related posts

  • Copilot x Zed

    Zed mediumAdept

    GitHub Copilot is now available in Zed v0.82, integrated by reusing the undocumented, minified Copilot LSP server shipped in the Neovim plugin, which Zed's built-in LSP support could drive directly. Supporting it required a new modal UI for Copilot's device-code OAuth flow and a 'suggestions' layer in Zed's DisplayMap that splices styled multi-line text into the buffer alongside folding and wrapping, covered by randomized testing. To keep it from being intrusive, Zed added per-language disable settings and a 75ms debounce, and gives the language's real LSP autocomplete priority over Copilot on conflicts.

  • Zed Weekly: #21

    Zed easyNovice

    Weekly team update from the Zed editor team. It covers initial Prettier integration and better LSP server log display, a storybook CLI for rendering new GPUI UI components in isolation, and Vim mode's command palette shipping to preview. Julia explains why vertical cursor movement drifts with mixed scripts, multi-codepoint graphemes like ZWJ emoji, and proportional fonts, and proposes tracking an intended pixel x-position resolved like a mouse click, which costs more compute. Other items include ClickHouse dashboard query optimization (minutes to under 10 seconds), the Semantic Index shipping to stable, cross-project following for channel notes, and CRDT Lamport-timestamp-based change notifications.

  • Zed Weekly: #28

    Zed mediumAdept

    Zed is rewriting its editor as Zed2 in three phases (runnable core editing, productivity features like collaboration, terminal and Vim mode, then flagship features like Assistant, Copilot and Chat), aiming for a preview by end of 2023 and open-sourcing shortly after Zed2 supersedes Zed1. Team updates cover porting core UI such as popovers, autocomplete menus and breadcrumbs. The UI component work introduces a shared `ButtonLike` base for `Button` and `IconButton` and Rust traits like `Selectable` that concrete components delegate to, keeping APIs and styling consistent. Other updates include typescript-language-server, eslint and prettier fixes, plus an idea for searching gitignored directories in the file finder.

  • This Week at Zed Industries: #12

    Zed mediumAdept

    Zed publicly launched its preview channel and reports progress across the editor: Vim search commands, macOS ctrl-click remapped to right click in the platform layer, terminal Cmd+hover navigation, a semantic index that collapses nested tree-sitter symbols to cut embedding tokens, and a lock-contention bug where slow git status in huge repos serializes file scanning. The most substantive section covers CRDB, Zed's planned collaboration backbone. It uses serde-bare instead of Protocol Buffers so message types live entirely in Rust, routes messages by TypeId, and syncs replicas with vector clocks as a distributed set union. Operations are applied by reconstructing revisions from a DAG of operations with cached snapshots and copy-on-write B-trees.

  • Zed Weekly: #25

    Zed mediumAdept

    Zed is rewriting its UI framework as GPUI 2 and porting the whole editor onto it before open-sourcing, trading feature work for better ergonomics while keeping GPUI 1's performance. All state lives in an AppContext that acts like an application-specific heap: Model<T> handles are dereferenced through a context, and models emit and subscribe to events. View<T> wraps models whose types implement a Render trait that returns element trees. Components, Tailwind-style styling helpers, a color-scale-based theme system and a new layout engine and executor round out the design. Bottleneck crates (project, workspace, editor) made the port largely serial, so the team leaned on Rust's type system and Zed's collaborative editing to pair on it, with roughly a third to half of the app ported after two weeks.

The quest for software engineering knowledge.

Look:
Layout: