Editor renaissance: Helix

There seem to be a lot of new editors making the rounds at the moment.

I’ve tried Zed. Zed holds a lot of promise, and is fast, but early stages and the Vi mode’s pretty awful (although they know this, and are up for fixing it as they recognise that it is important to a lot of people).

I’ve tried Lapce; quite a lot of features, but felt quite immature in use. Again, a recognition that Vim-like behaviour was important. But it didn’t really feel like one could take it on day-to-day.

And obviously I’ve tried Neovim, and, in Neovim, found an editor I really like.

But now I’m trying out Helix. While Zed and Lapce are GUI-based editors, Helix is a terminal editor. It’s a lot like Vim, but has more batteries included. Also, it has a new way with modal editing that I’ve not used before. Helix is receiving major new functionality at a reasonable pace. It seems like a very promising project.

So far, I’m finding Helix has a sweet spot between being quite new, and yet with enough features for serious use. And it’s not emulating Vim, it just is a “modern Vim” built fresh from the ground up, albeit with the new way with motions and commands that I mentioned (we’ll talk about it in a moment).

Compare this with the screenshot of Neovim in Modern Vim, they’re nearly identical. Helix manages to capture that Vim feel I like.

A new way to command

I believe this new way of commanding originated with Kakoune.

In Vim, you choose a command, like c for “change”, and then say what motion you want it to execute on, like w for word. You can also enter “visual” mode, using v, to create larger visual selections to execute upon.

Helix unifies these concepts. Commands like c are always executed on a selection. This sounds like a pain. In Vim, you have to use enter visual mode to create a selection. But in Helix, every motion creates a selection. So when you use w in normal mode to move by a word, it also selects the word. Then you can use c to change the word (ie, the selection).

So for some common things, the order is reversed. In Vim, you’d cw to “change word”. But in Helix, you wc to select a word, then change it. To create larger selections, you enter “extend” mode. In normal mode, each motion creates a new selection. But in extend mode, each motion adds to the existing selection. As extend mode is a lot like visual mode in Vim, entering extend mode is done with the same key, v.

Overall, I like the consistency, but it is taking a bit of getting used to.

But much is the same

It’s clear that Helix tries to stick to Vim as much as possible. Some places I’ve seen this:

  • gd goes to definiton (using LSP if available 👏)
  • [Ctrl-O] pops an entry of the jump list (ie, go back after going to definition)
  • Esc takes you to normal mode, and : allows you to enter a command.

And many, many more. I’ve hit a lot of the key mappings that I recently learned in Neovim, and they’ve worked. Helix basically is trying to be Vim, but with the new select/command metaphor, and a lot of other modern things (including being written in Rust).

I’m not sure how long I’ll keep with Helix, but I’m enjoying trying a few new editors and paradigms. Helix builds in a lot of the functionality I’d added to Neovim using plugins, such as Telescope-like fuzzy finders, which-key-like help popups as you type commands, and so on. But it’s missing some things I find really useful. Particularly for Markdown, I miss a spell-checker and the “sentence” motion; Helix only has “paragraph”.

← Older
Link: The Four Hobbies
→ Newer
Nvim: what is Mason?