Configure Helix to use ElixirLS

petros

Petros Amoiridis

Posted on June 14, 2023

Configure Helix to use ElixirLS

My favorite editor is Zed, but I also like to have Helix configured for quick edits directly in the terminal.

Like Zed, Helix is written in Rust which makes it fast. Helix is a post modern text editor that runs inside the terminal. It uses the VIM philosophy, but changes a few things.

It comes pre-configured with a few things, like syntax highlighting. But it needs some work (minimal) to add things like a language server for your favorite language.

I use Elixir, so I want to configure ElixirLS to work with Helix.

  1. Check if hx already knows where ElixirLS is

    Configured language server: elixir-ls
    Binary for language server: /path/to/elixir-ls/elixir-ls
    Configured debug adapter: None
    Highlight queries: ✓
    Textobject queries: ✓
    Indent queries: ✓
    
  2. If it doesn't know about it (it will report it can't find the binary), or you want a very specific version of ElixirLS, download the latest release from GitHub.

  3. Unzip the archive

  4. Locate language-server.sh and rename it to elixir-ls

    mv /path/to/language-server.sh /path/to/elixir-ls
    
  5. Move the whole ElixirLS folder to a preferred path

  6. Add the following to your .zshrc

    export="/path/to/elixir-ls:$PATH"
    

Now if you run hx --health elixir it should be able to find the server. Helix expects elixir-ls to be in the PATH, that's why we needed to rename language-server.sh.

If you are looking for more information or ways to customize language servers, you can check Helix's documentation.

💖 💪 🙅 🚩
petros
Petros Amoiridis

Posted on June 14, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Configure Helix to use ElixirLS
elixir Configure Helix to use ElixirLS

June 14, 2023