If you’re a developer interested in productivity, you’ve likely heard of Vim. You know it’s not just an editor, but a powerful concept—a language for manipulating text at the speed of thought. But what if that language could be even more intuitive, with modern features built-in from the ground up?
Enter Helix, a post-modern text editor written in Rust. It takes inspiration from Vim and other editors like Kakoune, but it isn’t a clone. It’s a re-imagining.
Why not just use Vim? Vim is legendary, but often requires a significant investment in configuration to feel modern. Helix is designed to work brilliantly out-of-the-box, with zero setup. It comes with pre-configured support for Tree-sitter (for superior syntax highlighting and code navigation) and Language Server Protocol (for diagnostics, code completion, and go-to-definition).
Most importantly, it makes a fundamental change to the “Vim grammar” that many find more intuitive. This guide will teach you how to think in Helix. We’ll skip the installation and focus on the 80% of the editor that will provide 100% of your initial productivity.
If you remember only one thing, make it this: Helix reverses Vim’s grammar.
action -> motion/object
model. You decide what to do first, then where to do it. To delete a word, you type dw
(delete word). You commit to the action before seeing what it applies to.selection -> action
model. You decide where first, then what to do. To delete a word, you type w
to select the word, and you get immediate visual feedback. Once you’re happy with the selection, you press d
to delete it.This small change is a profound philosophical shift. You always see what you’re about to change before you change it. The editor provides constant feedback, which makes learning and operating it feel more predictable and less error-prone. In Helix, a cursor is just a selection of width 1. Movement is selection.
Let’s learn the core vocabulary. Forget the huge keymap tables for now; these are the essentials.
Because movement is selection, these commands are your primary way of interacting with text.
Key(s) | Action | How to Think About It |
---|---|---|
h j k l | Move left/down/up/right | The classic Vim arrows. |
w | Select to the start of the next word | ”Word” |
b | Select to the beginning of the word | ”Back” |
e | Select to the end of the word | ”End” |
x | Select the current line | ”extend line” |
% | Select the entire file | The “whole thing” |
gh / gl | Go to the start/end of the line | ”Go home” / “Go last” |
m
How do you select the text inside a pair of parentheses or quotes? With text objects! In Helix, text objects live under the m
key (“match”). The pattern is simple: m
+ i/a
+ character
.
i
means inside the object.a
means around the object (including the delimiters).Keystroke | Action |
---|---|
miw | Select inside the current word. |
mip | Select inside the current paragraph. |
mi( | Select inside the parentheses () . |
mi" | Select inside the double quotes "" . |
Put your cursor inside some "quoted text"
and press mi"
. The text is instantly selected. Now you’re ready to perform an action.
You’ve made your selection. Now what do you want to do with it?
Key | Action |
---|---|
d | Delete selection. |
c | Change selection (deletes, then enters Insert mode). |
y | Yank (copy) selection. |
p | Paste after selection. |
r | Replace selection with the next character you type. |
i | Enter Insert mode before the selection. |
a | Append; enter Insert mode after the selection. |
u / U | Undo / Redo |
Esc | Return to Normal mode. |
Let’s put it all together (Intentional Repetition!): Now that you know how to select and how to act, you know how to do almost anything.
mi"c
.xd
.mipy
.
The pattern is always the same: find your target, select it, and then apply your action. Select, then act.When you yank or delete text, it goes into a default clipboard. But what if you want to copy or cut multiple different things? Use registers! A register is just a named clipboard.
The "
key is your gateway to registers.
"a
- This prefix says “the next command should use register a
”. You can use any letter.Example Workflow: Swapping two functions.
mif
(match inside function).a
: "ay
.mif
.b
: "by
.mif
.b
to replace it: "bp
.a
: "ap
.Once you’re comfortable with the basics, these tools will multiply your efficiency.
Here’s where Helix truly shines. You can create multiple selections and edit them all at once. The most common way to do this is with search.
Workflow: Rename a variable.
w
to select it.s
(select all regex matches). Helix finds every occurrence of that word in the file and creates a cursor at each one.c
(change). Now type the new variable name. You are editing all occurrences simultaneously.Escape
when you’re done.A macro is simply a recording of your keystrokes that you can replay. In Helix, macros are stored in registers—just like text!
Workflow: Add a prefix to several lines.
Q
to start recording a macro (it will ask for a register, let’s use a
).I
to enter insert mode at the start of the line, type your prefix, and press Escape
.j
to move down to the next line.Q
again to stop recording.q
to replay the macro from register a
. Press it repeatedly to apply the change to the next lines.You can leverage the entire ecosystem of command-line tools directly on your text. The |
(pipe) key sends your current selection to an external command and replaces it with the output.
Example: Sorting lines.
x
and pressing j
a few times).|
to bring up the shell command prompt.sort
and press Enter.You can use this with any shell command: uniq
, awk
, or even jq
to format a selected JSON block.
Helix comes with “batteries included” for project-wide tasks.
The Space
key is your best friend. It opens a menu of common, powerful actions.
Keystroke | Action |
---|---|
Space + f | Open the file picker. Fuzzy find any file in your project. |
Space + / | Global search. Search for a string across your entire project. |
Space + k | Knowledge/Hover. Shows documentation for the symbol under the cursor. |
Space + ? | Command palette. Search for any Helix command. |
Thanks to built-in LSP and Tree-sitter, you get these smarts for free.
Keystroke | Action |
---|---|
gd | Go to definition. |
gr | Go to references. |
[f / ]f | Go to the previous/next function. |
[t / ]t | Go to the previous/next type (class, struct). |
[d / ]d | Go to the previous/next diagnostic (error/warning). |
When you’re comfortable and want to make the editor truly yours, here’s where to look next.
Configuration (config.toml
): In ~/.config/helix/
, you can create a config.toml
file. This is where you can change settings or remap keys. For example, to make Ctrl+s
save the file (like in most other apps), add this:
[keys.normal]
C-s = ":w" # Map Ctrl-s to the :write command
Language Settings (languages.toml
): This file, in the same directory, is where you can add new language servers or override settings for a specific language (like your formatter’s line width).
Theming: Helix themes are just .toml
files. Find one you like online, drop it into ~/.config/helix/themes/
, and enable it in config.toml
by adding theme = "your-theme-name"
.
Concept | Keystrokes & Examples |
---|---|
The Core Loop | selection -> action. (e.g., w to select, d to delete). |
Modes | i → Insert, v → Select, Esc → Normal. |
Essential Selections | w,b,e (words), x (line), % (file), gh,gl (line ends). |
Essential Actions | d (delete), c (change), y (yank), p (paste), r (replace). |
Text Objects (m) | miw (in word), mip (in paragraph), mi” (in ”), mi( (in (). |
Registers | ”a prefix. “ay (yank to a), “ap (paste from a). |
Macros | Q + register (start/stop record), q (replay from last register). |
Shell Pipe | Select text, then ` |
Multiple Selections | s (select all regex matches), S (split selection on regex). |
Project Navigation | Space f (file picker), Space / (global search). |
Code Intelligence | gd (definition), Space k (docs/hover), [f / ]f (jump function). |
Undo / Redo | u (undo), U (redo). |
Enjoyed the article? I write about 1-2 a month. Subscribe via email or RSS feed.