cat posts/2024-01-25-my-editor-in-2024.md
My editor in 2024
In 2021 I wrote that your editor really doesn’t matter, and I still mostly think that. I’m about to write 900 words about mine anyway, because Zed went open source yesterday and I spent the evening in it instead of doing what I’d planned to do, which is how editor posts always start.
Zed
If you haven’t seen it, Zed is a new editor from Nathan Sobo, Antonio Scandurra and Max Brunsfeld, some of the people who made Atom at GitHub (and in Brunsfeld’s case, Tree-sitter, which comes up again below). It’s written in Rust, with its own GPU-rendered UI framework called GPUI, and you’ve been able to download a beta for a while. Yesterday’s announcement put the editor itself on GitHub under the GPL, the collaboration server under the AGPL, and GPUI under Apache 2.0. Their argument is that an editor used by programmers gets better when programmers can fix it, and the business is going to be the services around it, the collaboration and AI features, instead of the editor.
First impressions, after one evening on a mid-sized Ruby project:
It’s fast. Not “fast for an Electron app”, properly fast, in the way Turbo C felt on DOS, where the screen has already changed by the time your finger comes off the key. Opening the project, jumping to a file, scrolling a 4,000-line file, all instant. Atom was famous for being slow, and the same people have clearly spent years being annoyed about that.
The Vim mode is good. I didn’t expect it to be. Motions, text objects, visual mode, . repeat, all there. A couple of my habits with registers and macros felt slightly off, though I’d want more than an evening before I blamed Zed and not myself.
And it’s Mac only, for now. Linux is in progress, by their account, and Windows is further out. That settles it for me, for the moment, and I’ll come back to why.
What I actually use
Most days, Neovim, in a terminal. I’ve been moving that way for a couple of years and it’s now where I spend probably 70% of my editing time. The config is a few hundred lines of Lua, started from kickstart.nvim a while ago and then grown the way configs grow. The core of it is lazy.nvim for plugins, Telescope for finding files and grepping, the built-in LSP client with Mason to install language servers, Tree-sitter for highlighting and for text objects that understand the language (select this function, select this argument), and copilot.vim, GitHub’s own plugin. That’s most of it. I have a colorscheme I’ve stopped thinking about, which is the right relationship to have with a colorscheme.
The rest of the time it’s VS Code, with the Vim extension, for one reason: our .NET services. C# in Neovim works, through OmniSharp, and for small changes it’s fine. For a big solution with a debugger, test explorer and a refactoring I want to trust across forty files, VS Code with the C# Dev Kit is better, and I’m not going to pretend otherwise to win an argument. On the Windows laptop I occasionally still open full Visual Studio, mostly for the profiler, which nothing else matches.
Why the terminal
The reason Zed’s Mac-only status matters is that the thing I value most about my setup is that it’s the same everywhere. I use a Mac, a Windows laptop and Linux boxes every week, and the editor I use on all three is the same editor with the same config, pulled from the same dotfiles repo. When I ssh into a box to look at something, I’m not in a worse editor, I’m in mine. VS Code’s Remote-SSH gets close to this, and I used it for a long stretch when I moved to the M1, but it’s a client installing a server on the remote end, and on a locked-down machine that’s not always allowed.
The modal part I’d keep in any editor. I said I’d never get it, in a post from 2009 that opens with “I don’t use vim or emacs”, and I was wrong about that in an interesting way. What I didn’t understand then is that Vim’s keys aren’t a list of shortcuts, they’re a small language. d is delete, i( is “inside the parentheses”, and you put them together, so di( works the first time you try it even though nobody taught it to you. With Tree-sitter and its text objects plugin the nouns get bigger: daf deletes a whole function, in Ruby or C# or Lua, because the editor knows what a function is. That grammar is the reason every editor I’ve looked at in the last few years, Zed included, ships a Vim mode. Once you have it in your hands you can carry it into whatever editor the project needs.
Bram Moolenaar died last August, and a lot of the writing about him said something like this, that what he kept alive wasn’t an editor so much as a way of editing. I think that’s right.
Will I switch?
Not this year, unless Zed gets to Linux sooner than I think, and maybe not then. I’ll keep it on the Mac and use it for the things where it’s clearly better (it’s very good at being an editor someone else is watching, which is what their collaboration features are for, and pair programming over a screen share is miserable). I’d like it to succeed. A fast, native, open source editor from people who’ve built one before is a good thing to have in the world, and one that isn’t owned by the company that owns GitHub and Copilot and VS Code is, I think, an even better thing.