Skip to content

Installation

To install Helix, follow the instructions specific to your operating system and package manager.

Package Managers

Add the PPA for Helix:

Terminal window
sudo add-apt-repository ppa:maveonair/helix-editor && \
sudo apt update && \
sudo apt install helix

Pre-built binaries

Download pre-built binaries from the GitHub Releases page.

  1. Add the hx binary to your system’s $PATH to use it from the command line.

  2. Copy the runtime directory into the config directory:

    • ~/.config/helix/runtime on Linux and MacOS
    • %appdata%\helix\runtime on Windows

Building from source

To get the latest features in the Helix editor, you need to build from source from the master branch.

Requirements

Installation

  1. Clone the repository:

    Terminal window
    git clone https://github.com/helix-editor/helix && \
    cd helix

    The examples in this documentation assume installationinto either:

    • ~/src/ on Linux and macOS
    • %userprofile%\src\ on Windows
  2. Compile from source:

    Terminal window
    cargo install --path helix-term --locked

    This command will create the hx executable and construct the tree-sitter grammars in the local runtime folder.

Configuring Helix’s runtime files

The runtime directory is one below the Helix source, so either export a HELIX_RUNTIME environment variable to point to that directory and add it to your ~/.bashrc or equivalent:

Terminal window
export HELIX_RUNTIME=~/src/helix/runtime

Or, create a symbolic link:

Terminal window
ln -Ts $PWD/runtime ~/.config/helix/runtime

If the above command fails to create a symbolic link because the file exists either move ~/.config/helix/runtime to a new location or delete it, then run the symlink command above again.

Multiple runtime directories

When Helix finds multiple runtime directories it will search through them for files in the following order:

  1. runtime/ sibling directory to $CARGO_MANIFEST_DIR directory (this is intended for developing and testing helix only).
  2. runtime/ subdirectory of OS-dependent helix user config directory.
  3. HELIX_RUNTIME environment variable.
  4. Distribution-specific fallback directory (set at compile time—not run time— with the HELIX_DEFAULT_RUNTIME environment variable)
  5. runtime/ subdirectory of path to Helix executable.

This order also sets the priority for selecting which file will be used if multiple runtime directories have files with the same name.

Validating the installation

To make sure everything is set up as expected you should run the Helix health check:

Terminal window
hx --health

For more information on the health check results refer to Health check.

Configure the desktop shortcut (Linux only)

If your desktop environment supports the XDG desktop menu you can configure Helix to show up in the application menu.

  1. Copy the provided .desktop and icon files to their correct folders:

    Terminal window
    cp contrib/Helix.desktop ~/.local/share/applications && \
    cp contrib/helix.png ~/.local/share/icons
  2. Convert the links in the .desktop file to absolute paths to avoid potential problems:

    Terminal window
    sed -i -e "s|Exec=hx %F|Exec=$(readlink -f ~/.cargo/bin/hx) %F|g" \
    -e "s|Icon=helix|Icon=$(readlink -f ~/.icons/helix.png)|g" ~/.local/share/applications/Helix.desktop

To use another terminal than the system default, you can modify the .desktop file. Depending on which terminal you use:

Terminal window
sed -i "s|Exec=hx %F|Exec=kitty hx %F|g" ~/.local/share/applications/Helix.desktop && \
sed -i "s|Terminal=true|Terminal=false|g" ~/.local/share/applications/Helix.desktop
Terminal window
sed -i "s|Exec=hx %F|Exec=wezterm start hx %F|g" ~/.local/share/applications/Helix.desktop && \
sed -i "s|Terminal=true|Terminal=false|g" ~/.local/share/applications/Helix.desktop
Terminal window
sed -i "s|Exec=hx %F|Exec=alacritty --command hx %F|g" ~/.local/share/applications/Helix.desktop && \
sed -i "s|Terminal=true|Terminal=false|g" ~/.local/share/applications/Helix.desktop
Terminal window
sed -i "s|Exec=hx %F|Exec=gnome-terminal hx %F|g" ~/.local/share/applications/Helix.desktop && \
sed -i "s|Terminal=true|Terminal=false|g" ~/.local/share/applications/Helix.desktop
Terminal window
sed -i "s|Exec=hx %F|Exec=rio -e hx %F|g" ~/.local/share/applications/Helix.desktop && \
sed -i "s|Terminal=true|Terminal=false|g" ~/.local/share/applications/Helix.desktop