Home / Companies / Zed / Blog / June 2024

June 2024 Summaries

2 posts from Zed

Filter
Month: Year:
Post Summaries Back to Blog
The text explores the complexities of text coordinate systems within the Zed text editor, highlighting the use of multiple systems beyond the standard lines and columns, including Points, Offsets, UTF-16 Offsets, DisplayPoints, and Anchors. Points are a basic system involving rows and columns, but navigating them can be tricky due to varying line lengths. Offsets provide a byte count from the start of a document, while UTF-16 variants are used for communication with language servers. DisplayPoints refer to the visual representation of text, taking into account features like soft-wrapping and inlay hints, which differ from the actual file structure. Anchors differ as they provide a logical coordinate system that maintains references to text positions despite edits, essential for collaborative editing and background processing. Anchors, tied closely to Zed's collaborative features and CRDTs, use Lamport timestamps to maintain stable references, allowing for continuous text manipulation and background processing without losing position integrity.
Jun 27, 2024 2,785 words in the original blog post.
After 15 years of using Vim, the author has transitioned to using Zed as their main editor, drawn by its Vim mode, which mimics Vim’s functionalities to a significant extent. Zed’s Vim mode incorporates many typical motions, operators, and features such as visual modes and window management keybindings, while also improving and adding new features like named registers and buffer-local marks. The article explores the complexities of implementing a Vim mode within Zed without embedding Neovim, as doing so would require discarding Zed’s unique foundational elements such as its data structures, CRDTs, and collaborative mechanisms. Instead, Zed has developed its own Vim mode that integrates seamlessly with its existing capabilities, offering a combination of both editors' strengths while leveraging Neovim in tests to ensure compatibility and accuracy. This approach maintains Zed’s core architecture and enhances its performance as a high-performance, collaborative text editor, while continuing to evolve its Vim mode to include more features from the original Vim experience.
Jun 13, 2024 2,313 words in the original blog post.