"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

2023-08-19

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:

Read More...


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

2023-08-04

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:

Read More...


Open same file in already running instance of Helix

2023-08-02

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.

Read More...


File tree workaround for Helix

2023-08-02

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.

Read More...


How to disable ligatures in WezTerm?

2023-08-01

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.

Read More...


Reload Helix automatically after switching from lazygit

2023-07-25

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:

 1#!/bin/sh
 2
 3source wezterm-split-pane.sh
 4
 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
 8else
 9    echo "lazygit" | wezterm cli send-text --pane-id $pane_id --no-paste
10fi

Read More...


Helix: How to jump to the build error from the terminal output?

2023-07-21

In my previous post, I shared how I run code in Helix, and today I’ve taken things a step further by integrating WezTerm into Helix. Now, after running the code, if I encountered errors or warnings, I can simply click on the corresponding file to open it in Helix at the specific line and column number.

Previously, I had to either look at the line number and navigate to that specific line or manually copy the file path and open it in Helix, which was somewhat cumbersome.

Read More...


How I run code in Helix editor?

2023-07-14

In my previous post, I mentioned that I’ve made the switch to WezTerm and Helix, and today I want to share how I run my code in this setup.

Previously, I would split Wezterm into two panes and run the code in a new pane. However, I found it cumbersome to type different commands for each programming language (Go, C, Racket, and so on). While auto-completion helped to some extent, or using control-p to run the previous command, it still took up a little time.

Read More...


How I setup a new Macbook in 2023

2023-05-06

I purchased my first MacBook Pro in 2013 prior to transitioning to remote work. In my job, we were using saltstack to build an automation tool. In order to delve deeper into Salt, I decided to configure my Macbook using it, and I documented the process here.

I also utilized this method to set up another Macbook for my older sister.

In 2018, due to work requirements, 8GB of memory proved insufficient to run Windows on VirtualBox, prompting me to acquire a second hand MacBook with 16GB of RAM.

Read More...