Will Soares

github profilelinkedin profiletwitter profilespotify profile
post cover

Three months using Rust-based editor Zed and here's my two cents

August 11, 2024 7 min read
ToolingProductivity

So three months ago I got a bit bored and decided to try out the new "blazing fast" code editor in the playground: Zed. Because ... why not?

In all seriousness, the truth is that I was tired of how slow Visual Studio Code (my main editor) got as I increased the number of extensions installed. Opening a project would most of the time take long enough to leave me frustrated. Other times I would just stick to vim, especially when editing only one file within a project.

When I first heard of Zed and went to check their website, the first thing that got my attention was the benchmarking they did on startup time compared to other known text editors in the market like Sublime and VS Code.

Screenshot 2024-08-06 at 00.08.56.png

When I saw that, I knew I had to try it.

A bit of context

The beta version of Zed was released back in 2023 and this year it became open source, gaining a lot more traction and therefore people's attention.

The creators behind Zed are the same ones behind Atom, Tree-sitter, and Electron. Because of that, I'd say Zed is promising considering it is backed by lessons learned from building another code editor. As Nathan Sobo shared in this interview, things didn't go entirely as he wished with Atom so this seems to be his second attempt at achieving the idea he initially had in mind for Atom.

Based on how Zed is marketed on its website, it seems like the main highlights can be grouped into two aspects: high performance and collaboration.

Many of the highlighted collaboration features are things like shared workspaces, voice/text channels (Discord-like), and real-time shared navigation (similar to how you can see other users navigating through a Figma project).

When it comes to performance, Zed leverages the features provided by Rust to parallelize tasks across multiple cores and efficiently allocate work across threads. The technicality here goes way beyond that, involving topics like GPU usage, context-free grammar, Conflict-Free Replicated Data Types, etc. Things I won't get into in this blog post, but you can check their blog for more info.

Positive aspects

Let's get right into it and talk about the pros I've seen in these past three months.

Fast startup time

As I expected, this is indeed the biggest advantage I've seen. Opening a project from the terminal with zed feels instantaneous (almost 100% of the time). I also tried with larger projects and startup times looked way better compared to VS Code (even after uninstalling most of the extensions I had).

With VS Code I always have this clear perception of components individually loading and becoming available at different times. With Zed, it feels like everything is one component (even though it isn't of course) and all parts of the editor become available for you at the same time. I'm guessing this can be a result of their GPUI framework, which rasterizes the entire window on the GPU, which is faster for that kind of work.

Easily switch between projects

With VS Code I always felt that this was such a missed opportunity. Something so simple such as switching to a different project without having to keep many windows open, isn't available by default.

From quick research, it seems like you can have something like that in VS Code with an extension called Project Manager. But again, why do I even have to install and configure an extension for doing something that simple?

I've also read about VS Code Workspaces but that seems to be aimed at a lot more than simply switching between projects, thus it takes some configuration to make things work as well.

With Zed, this feature is part of the core product. You can click on the name of the project in the top left corner and search for the project you want to switch to (though you need to open the project manually at least once for it to show up in the list of projects available).

Integrated Vim mode

For this one, I have to be honest and say I am NOT a seasoned user of Vim. I do find it very useful when I want to quickly update files (mostly system files) or when doing git-related stuff like squashing/fixing up commits. Anything outside of that realm though is done outside of Vim.

The thing is, having the option of using Vim in a way that integrates with my usual text editor is something I find quite interesting and would be willing to try. All the perks of Vim, especially the many clever shortcuts, together with all the visual aid you're used to (maybe as an escape hatch 😅).

I won't get into details on how you can also have this in VS Code. The fact that it is done through an extension is already a drawback compared to Zed.

Miscellaneous

The items listed here are not actual advantages over other tools since they are also basic features provided elsewhere, but here they are to highlight that Zed is not far from supporting most of the basic use cases we are already used to.

These include (but are not limited to):

  • file outline panel: where you can see all the "blocks" in one file and jump to them by clicking on each item. In a JavaScript file, for instance, this can be a list of all the function definitions. In a Markdown file, this would be the title, subtitles, sections, etc.
  • integrated terminal
  • AI features: these include integrations with Github Copilot, and different AI models such as Gemini, Ollama, Claude, and OpenAI's GPT.
  • Built-in REPL: REPL stands for Read, Evaluate, Print, and Loop. With this, you can see the results of a command immediately in your editor as it turns your editor into an interactive environment (like when you run node in your terminal for instance). It is available by default in Zed and for JavaScript and Typescript it uses deno.

Not-so-positive aspects

Be aware that most of the points mentioned in this section are due to the early phases Zed still is in. There is a lot of ongoing work to improve things, so it's important to check their progress in their GitHub repository or just try it out, considering these things can quickly get outdated.

Limited number of extensions

As of now, the number of extensions available is still considerably low. For developers who rely on several extensions, there would be the need to get used to coding without some of them.

I am not a heavy user of extensions and even some of the ones I was using turned out not to be that necessary. Experimenting with Zed has been a little bit enlightening in that sense too.

Limited integration with Git

This is another point that did not impact much on my workflow. I am most of the time handling Git-related stuff through the terminal instead of using Git GUI tools. I prefer to keep those concerns in different places.

However, the one thing I was heavily relying on VS Code for was handling merge conflicts. I would open the files with conflicts in VS Code and either choose Accept Current or Accept Incoming. To be honest, I went back to VS Code a few times in the past three months when resolving merge conflicts.

At the moment, Zed does not even provide highlighting for the conflicts tagged in a file.

A few bugs (could be considered UX improvements though) 💅

Up until now, I still find some annoying things in Zed that I would love to see fixed or improved. It's the old story of wondering if it's a bug or a feature.

When there is already a window open for a project, opening another project from the terminal shows you the window that was previously open instead of going to the project you wanted to go into. The window for the other project is open, but the focus does not go immediately to the new project you opened, so you have to manually switch to that window.

Another thing is the experience when searching for something within a project. This might be entirely personal and does not bother anyone else, but after I type Enter to search for some term the search input loses focus and the next keystroke goes into the first file that showed up in the search results. I would love to keep the behavior I have in VS Code, where the focus is kept on the search input after submitting a search.

Conclusion

After careful consideration, and balancing the pros and cons above, I have decided that I can't completely migrate to Zed, not at this time at least. There is still a long way to go before Zed replaces VS Code for me.

Zed is fast, simple, and promising but for now, I am keeping VS Code and switching between the two as I see fit. I'll still be trying out Zed for most of the day and switching to VS Code when in need of some help from extensions.

I am still very curious about the future of Zed and believe that it will grow to become a more robust tool while keeping speed as the most important metric. The expectation is that in a few months from now, I'll be switching back to VS Code less and less.

< Home