Helix Editor – 90% of Neovim With Kakoune
Tags: neovim, kakoune, helixeditor, helix
Published: 2022-10-26 09:08:45

---
title: Helix Editor – 90% of Neovim With Kakoune
published: true
cover_image: https://images.unsplash.com/photo-1643780668909-580822430155?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=420&w=1000
date: 2022-10-26 11:10:00 UTC
tags: neovim, kakoune, helixeditor, helix
canonical_url: https://www.rockyourcode.com/helix-editor-90-percent-of-neovim-with-kakoune/
---

I’ve spend too many hours setting up the recent NeoVim features (since v0.5): [tree-sitter](https://tree-sitter.github.io/tree-sitter/), [nvim-lsp](https://github.com/neovim/nvim-lspconfig), [nvim-cmp](https://github.com/hrsh7th/nvim-cmp).

Why?  
NeoVim’s parser tool [tree-sitter](https://tree-sitter.github.io/tree-sitter/) offers a better integration of language servers, syntax highlighting and auto-completion.

## The Problem

Vim and NeoVim are great.  
However, I put a lot of effort into customizing these editors to my liking, so that I could comfortably use them for coding.

In fact, my [configuration](https://github.com/sophiabrandt/dotfiles/tree/main/vim) has become more complicated over the years.

Migrating my Vim configuration to take advantage of tree-sitter was an exercise in frustration.

## Better Than (Neo)Vim?

By chance I stumbled upon a review of [Rust text editors](https://matduggan.com/battle-of-the-text-editors/) on [lobste.rs](https://lobste.rs).

The article favorably mentions **[Helix](https://helix-editor.com/)**, a modal text editor inspired by Vim and [Kakoune](http://kakoune.org/).  
Other commentators also seemed taken with this new text editor.

![helix text editor](https://github.com/helix-editor/helix/raw/master/screenshot.png)

I gave Helix a try and I am pleasantly surprised.

Helix is a fully-fledged text editor that comes with wonderful capabilities out of the box.  
For example, you get a fuzzy file finder, language server integration, a [vim-surround](https://github.com/tpope/vim-surround)-like plugin and great editor themes for free.

In the end, Helix offers almost everything I need from a terminal-based text editor _with zero config_.

After wasting hours of my free time on tweaking NeoVim, Helix’s sane defaults and inbuilt features blew me out of the water.

## Kakoune – Why!?

Helix has one advantage over Vim/NeoVim - multiple cursors. This features makes text editing a smoother experience.

Multiple cursors come from [Kakoune](http://kakoune.org/), a text editor I never heard of.

Vim’s core editing model revolves around _verbs_ and _(text) objects_. For example, to delete a word, you type `dw`, like in a natural language like English.

Kakoune turns this model on its head: in Kakoune, you always select text objects first, then operate on them with words.

Helix uses the same model as Kakoune.  
The idea is that you always start by making a selection first (that way it’s interactive and you see that you selected the right thing), then you operate on it.

I’m not sure if I can forego my muscle memory and retrain myself to use the “Kakoune” way. For me, it feels incredibly awkward.

I am also missing some commands in normal mode.  
For example, I can easily move or copy lines to other locations in the file [without having to make a selection and without leaving normal mode](https://www.rockyourcode.com/til-about-copying-a-range-in-vim/).  
This is a clash with Kakoune’s/Helix’s philosophy.

What I am missing most is `ci` (for `change inside`).  
I often use this command to change text in brackets (`ci{`), single quotes (`ci'`) or other text objects.

## Now What?

Helix is in active development.  
But even so, the editor is already usable. Because it is written in Rust, it’s fast and stable.

The maintainers plan a [plugin system with WebAssembly](https://github.com/helix-editor/helix/issues/122), which would be a big milestone for the project.

All in all, Helix looks like a valid alternative to Vim/NeoVim if you like modal editors.

# My Configuration

Here is my complete configuration file:

```
theme = "nord"

[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"

[editor.statusline]
left = ["mode", "diagnostics"]
center = ["file-name"]
right = ["selections", "file-type", "file-encoding", "position-percentage", "position"]

[keys.normal]
g = { a = "code_action", o = "goto_last_accessed_file" }
"ret" = ["move_line_down", "goto_first_nonwhitespace"] # Maps the enter key to move to start of next line
X = "extend_line_above"
D = "delete_char_backward"

[keys.insert]
C-space = "completion"
# Move cursor in insert mode
A-h = "move_char_left"
A-j = "move_line_down"
A-k = "move_line_up"
A-l = "move_char_right"
A-o = "open_below"
A-O = "open_above"

```

It adds a default theme, a few convenience key mappings plus some customisation around the status-line and the cursor.

In comparison, here is [my code for the status-line in Vim/NeoVim _alone_](https://github.com/sophiabrandt/dotfiles/blob/main/vim/.vim/plugin/statusline.vim) – which is (more or less) a three-liner in Helix.

## Links

- [Helix](https://helix-editor.com/)
- [Kakoune](http://kakoune.org/)
- [Reviewing some new Rust text editors](https://lobste.rs/s/xyexnb/reviewing_some_new_rust_text_editors)