Helix Editor: Post Modern Editor

Kameshwarasekar
9 min readDec 23, 2023

--

Table of Contents
Ice Breaker
Why do people always talk about Vim?
What is Kakoune?
What is Helix?
Installing Helix
Coming here from Vim? Helix got your back
Tutorial
Modes, Modes, Modes…
Themes
Configurations
Final Words

Ice Breaker

The simplest and the most common ice breaker conversation between 2 or more developers include questions like “Which programming language do you like/use?”, “Which editor do you use?”, etc. As a developer, I ain’t gonna lie, we do tend to judge people’s skills sometimes based on the editors they use. The personal choice of editor is a classical example of developer’s discretion, there are tons of options out there, there is no one solution fits all, all have our own preferences and our own style. Thus, whichever editor you have, and however it is configured, as long as it meets your needs, you are good. But (yes, there is always a “But”), technologies always evolve, sometimes, we start hating something which loved dearly, we might be interested in some new technology which might require a new setup, maybe we are upgrading our hardware, and all these changes tend to affect the developer environment we have configured. And, one such cause affected me, introducing me to Helix, an amazing piece of post-modern art.

Why do people always talk about Vim?

Vim is a open-source, free to use terminal based editor introduced in 1991 and still have high popularity among developers due to it’s highly configurable, light-weight, and better keystroke nature. Bare-bone Vim is a pain, but if configured appropriately, it can be a really powerful tool. But why am I talking about Vim though this article is on Helix? Vim inspired Helix! Vim is like the Superhero who got old, and his successors are eyeing the throne. Helix was not the only editor which was inspired by Vim, there are several other vim based editors with popular ones like Neovim (aka Modern editor), Kakoune, gvim, etc. Neovim and Kakoune are amazing editors as well, but there are reasons why I prefer Helix. This is what the official Helix website has to say about it’s differences from Vim:

By starting from scratch we were able to learn from our experience with Vim and make some breaking changes. The result is a much smaller codebase and a modern set of defaults. It’s easier to get started if you’ve never used a modal editor before, and there’s much less fiddling with config files.

What is Kakoune?

In simple words Kakoune = Helix — (some built-in configurations). Earlier I would have mentioned that Helix was inspired by Vim, yes, but it is also inspired by Kakoune, at least that is what the developers of Helix claim. Kakoune is more like the first iteration of editors, based on Vim, which wanted to improve the keystrokes, selection manipulations and provide a more interactive experience and Helix built more features on top of that. As per the official Helix website, this is their thought on how Helix differs from Kakoune:

Mainly by having more things built-in. Kakoune is composable by design, relying on external tooling to manage splits and provide language server support. Helix instead chooses to integrate more. We also use tree-sitter for highlighting and code analysis.

What is Helix?

If you read the description, you might wonder, why is it called a post-modern editor, it is a joke, Neovim is modern editor, thus they call Helix a post-modern editor. But what is Helix?

Helix is Rust based modal text editor, which is light-weight, highly configurable, packed with several built-in features with no support for Plugin (as of now, they do have future plans though). Someone coming from Neovim/Vim background might wonder, how can a editor with no plugins be any good? Initially those were my thoughts as well, but Helix offers some amazing built-in feature support including Tree-sitter, Language server, multi-select, themes, etc.

Helix is a relatively new project compared to it’s counterparts, but it packs a punch. Not many are aware of existence of Helix, but it has been gaining significant popularity in the developer community in recent times.

Installing Helix

Helix documentation provides detailing instructions on installing the editor on multiple Operating systems. For more details regarding installation visit here. You can also download pre-built binaries from here.

Installing Helix in Ubuntu is pretty straightforward, just copy paste the command provided in the documentation, and you are good to go.

sudo add-apt-repository ppa:maveonair/helix-editor
sudo apt update
sudo apt install helix

Coming here from Vim? Helix got your back

Several key-bindings in Helix is difference than that in Vim. Helix has documented the major difference between the difference in Keybinding here. Getting used to new keystrokes is pretty hard, especially when you are already used to something else, but I have heard from many developers who switched to Helix from Vim that is was “Worth it”. Helix does seem to have more key presses compared to Vim in some cases, but in my opinion keybinding in Helix is better than that of Vim. Helix also allows us to configure custom key mapping which makes it very easier to work with.

Tutorial

Helix editor provided a comprehensive tutorial on getting started with Helix, and it might be a great starting point for beginners. Tutorial can be activated using “:tutor” command in Helix.

Modes, Modes, Modes…

Helix is a modal editor, meaning it works based on modes. Vim has 3 major modes, Normal, Insert and View. Helix ups it by a notch having 2 major modes, Normal and Insert along with 7 minor modes: Select/Extend, Goto, Match, Command, View, Window, Space.

Normal Mode:

Every time you start Helix, you will be default to Normal mode, and this is the mode where you will be spending majority of your time while using the editor. Navigating in code, switching to other modes, all initiates from the Normal mode. By default, all the 7 minor can only be access from Normal mode. You can switch to Insert mode from Normal mode using multiple keys:

i - insert before selection
a - insert after selection (append)
o - open line below selection
I - insert at start of line
A - insert at end of line
O - open line above selection

Insert Mode:

Any code changes will be done in Insert mode. By default, Esc key takes you to Normal mode from Insert mode. None of the default minor modes are accessible from Insert mode (by default), but Helix can be configured such that you can get into minor modes from insert mode and even create a new minor mode if you want, how cool is that! This comes in really handy when you want to perform some actions while in insert mode, you can switch to normal mode using “jk” (my custom config) instead of pressing Esc key.

Select/Extend:

Interestingly Select/Extend mode in Helix (not the View mode) relates to View mode in Vim. Activated with “v” from Normal mode, Select/Extend mode allows you to select text and manipulate your selection with search and replace, delete, duplicate, etc.

Goto Mode:

Goto is an interesting mode which comes out of the box with Helix, activated with “g” from Normal mode, allows us to jump around within a file and across files. If LSP is properly setup, then we will be able to perform actions like go to definition, reference, implementation, etc.

Match Mode:

Match is another interesting mode that Helix offers inspired by vim-surround and vim-sandwich. Match mode can be activated with “m” from Normal mode. This mode supports very handy operations like surrounding text with brackets/quotes, replaces the brackets/quotes and delete brackets/quotes. These can highly improve the speed of your coding.

Command Mode:

Command mode is sort of a pseudo mode where we execute commands. This mode can be triggered with “:” from Normal mode. Command mode is considered to be part of Normal mode in Vim, but is considered as a minor mode in Helix maybe due to the amazing suggestions that Helix offer. Anyone like me, who are just getting into modal editors would love the suggestions offered by Helix, it just makes life easier with minimal to no side-effects.

Window Mode:

Window mode is another cool feature built-in within Helix providing features like split screen and their manipulations . Window mode can be triggered with “Ctrl-w” from the Normal mode. This is one feature which is not supported by Kakoune but Helix does.

Space Mode:

A special mode in Helix which is kludge of mappings, mostly pickers. Space mode is activated by pressing “Space” in Normal mode. Nothing much to explain but quite a few to offer. Some of the commands which I love using in this mode include:

Space + f - file picker
Space + F - file picker in Current directory
Space + b - open current buffer

# I have custom mapping for these, but these should be useful for
# someone without custom mappings

Space + y - yank selection to clipboard
Space + p - paste selection from clipboard

Themes

Helix by default comes with a bunch of themes including the popular ones like gruvbox, dracula, github theme, etc. Helix also allows us to create custom themes, extend the current themes, allowing developers with a lot of options to choose from. A default theme can be set in the config.toml file, but theme can be changed anytime during the runtime using “:theme” command. Over the past few months, I have browsed for different themes and have added them to my github. You can access them here:

Configurations

Configuration is what really sets apart Helix from it’s counterparts. I have seen developer configurations for Vim and Neovim with more than 500 lines of code, but Helix just makes your life so easy by providing most of the features out of the box, and you barely even need to worry about configuring anything, but if you want to, a simple toml file will do. Helix has pretty good documentation on Key mapping, commands, Language support and I encourage everyone to check it out.

So, to clarify before diving deep into configurations, Helix has two different config files “config.toml” and “languages.toml” where the former is used to configure the editor features like appearance, key-bindings, commands, etc while the later is used to configure the language configurations like LSPs and their configurations.

Config.toml

config.toml can be found at
~/.config/helix/config.toml for Linux and Mac
%AppData%\helix\config.toml for Windows

Helix provides great documentation on configurations and it is pretty easy to follow, there are several sections but most of them are set appropriately by default, thus not much config changes are needed. Here is my config.toml file if anyone is interested

Languages.toml

languages.toml can be found at
~/.config/helix/languages.toml for Linux and Mac
%AppData%\helix\languages.toml for Windows

Helix by default comes with Language Server Protocol(LSP) support for major programming languages. But Helix also allows us to add or modify the LSP configured for each language. All you have to for that is install the required LSP on your machine and add it to the PATH such that helix can access it. Starting Helix v23.10, Helix supports multiple LSPs for the same language.

For Python, Helix supports “pylsp” by default, but I configured Helix to use “pyright” and “ruff-lsp” along with “black” as the linter. Here is my full languages.toml file

Final Words

Helix is amazing, it makes me love coding more. The learning curve might be steep for beginners, but I know you can do it! Please share with me your thoughts on Helix in the comments. Thanks for spending your time reading my article, hope it helped.

--

--