"Life is all about sharing. If we are good at something, pass it on." - Mary Berry

Turning Helix into an IDE with the help of WezTerm and CLI tools


Helix as IDE

This post recaps previous series of posts about Helix.

  1. Running code
  2. Jumping to build errors
  3. Quickly select a command and open it in a new pane
  4. Testing a single function
  5. Git integration
  6. File tree
  7. Creating snippets
  8. How to debug?
  9. Interactive global search
  10. Opening file in GitHub

1. Running code

In my previous post, I shared a method for running code from within Helix by using this PR.

I later discovered another useful trick here. We can use wezterm cli get-text command to extract the filename and line number from the status line:


Debug Rust in Helix using lldb-vscode: display the contents of local string variables


In a previous post titled debugging Rust in Helix, I introduced a workaround using codelldb to address the visualization issue related to string variables within lldb-vscode.

However, the usage of codelldb presents some challenges:

codelldb breaks helix theme

In my quest for an improved debugging experience, I found rust-lldb, which impressively manages to display the contents of string variables:


How to debug Rust in Helix?


Helix supports debugging Rust by default using lldb-vscode. However, there is an issue where string variables are displayed as memory addresses instead of their actual values:

lldb-vscode - string variables memory addresses

Noticing that CodeLLDB natively supports visualization of most common Rust data types, I would like to give it a try.

Here’s the step-by-step process:

Download the CodeLLDB extension:

1$ cd ~/Downloads/
2$ wget https://github.com/vadimcn/codelldb/releases/download/v1.9.2/codelldb-aarch64-darwin.vsix

Setup the extension:

1$ mkdir -p ~/.local
2$ set fish_user_paths /Users/quantong/.local/extension/adapter $fish_user_paths
3$ codelldb

If you encountered this error:


nnn: wcswidth returns different values for same Unicode code point between macOS and Linux


When attempting to integrate nnn with Helix, I encountered an interesting issue that resulted in duplicate first characters in the filename:

nnn duplicate first character in the filename on macOS

What’s interesting is that this issue doesn’t occur on Linux:

nnn on Linux

I’ve spent several days troubleshooting this problem but haven’t been able to identify the root cause. The only solution I could come up with is a workaround, and I must admit, I’m still not entirely satisfied with it.


WezTerm: quickly select a command and open it in a new pane


In my previous post, jump to build errors with WezTerm, I demostrated how to navigate to build error using hyperlinks. One limitation of that approach is that it requires a mouse click.

In this post, I explore how to achieve the same functionality using a shortcut key in WezTerm, thanks to QuickSelectArgs feature.

WezTerm’s QuickSelectArgs allows us to bind a shortcut key to select specific patterns and perform actions on the selected text. Let’s say we have the following warning:


File tree workaround for Helix


nnn as a file tree workaround for Helix

Many people have expressed that the absence of a file tree is what prevents them from using Helix.

If, for some reasons, you cannot use the PR #5768, here’s a workaround to create a file tree using WezTerm and nnn

The idea here is to implement a custom opener in nnn. When navigating to a file, it will be opened using hx in the right pane. When opening another file, it checks if there is a running instance of hx in the right pane and sends the :open $1\r command to that pane.


Open same file in already running instance of Helix


Recently, I came across this issue:

I find that I have occasionally (frequently!) made the mistake of two instances of helix in different terminals editing the same file. This causes me a problem, because I will then have changes in one of the instances overwrite changes that are made in another. The worst case is when I accidentally switch back to an instance that has an older version of the file open.


How to disable ligatures in WezTerm?


As you may know, I switched to WezTerm and Helix a few months ago.

What surprised me is when I type != in Helix, it is rendered as . This behaviour also occurs with other character combinations, for example:

My first guess was that Helix had something to do with the font rendering but I encountered the same issue when typing directly into terminal.


How to create snippets in Helix?


Helix currently does not support snippets. However, there is a workaround to insert snippets using :insert-output to run a shell command. Still, this might not feel like the most natural way to work with snippets.

For instance, in GoLand, a similar feature called live templates allows you to type err and expand it into the following:

1if err != nil {

I wonder if I can archieve the same functionality in Helix by creating a simple language server


Reload Helix automatically after switching from lazygit


This is a continuation of the Helix series. In the previous posts, I shared methods to:

I also have a script to call lazygit from within Helix:

 3source wezterm-split-pane.sh
 5program=$(wezterm cli list | awk -v pane_id="$pane_id" '$3==pane_id { print $6 }')
 6if [ "$program" = "lazygit" ]; then
 7    wezterm cli activate-pane-direction down
 9    echo "lazygit" | wezterm cli send-text --pane-id $pane_id --no-paste