2023-03-06 13:27:17 +04:00
# Installing Helix
<!-- toc:start -->
- [Pre-built binaries ](#pre-built-binaries )
- [Linux, macOS, Windows and OpenBSD packaging status ](#linux-macos-windows-and-openbsd-packaging-status )
- [Linux ](#linux )
- [Ubuntu ](#ubuntu )
- [Fedora/RHEL ](#fedorarhel )
- [Arch Linux community ](#arch-linux-community )
- [NixOS ](#nixos )
2023-05-09 17:38:36 +04:00
- [Flatpak ](#flatpak )
2023-03-21 03:36:27 +04:00
- [AppImage ](#appimage )
2023-03-06 13:27:17 +04:00
- [macOS ](#macos )
- [Homebrew Core ](#homebrew-core )
- [Windows ](#windows )
2023-04-09 23:57:41 +04:00
- [Winget ](#winget )
2023-03-06 13:27:17 +04:00
- [Scoop ](#scoop )
- [Chocolatey ](#chocolatey )
- [MSYS2 ](#msys2 )
- [Building from source ](#building-from-source )
- [Configuring Helix's runtime files ](#configuring-helixs-runtime-files )
2023-05-09 17:38:36 +04:00
- [Linux and macOS ](#linux-and-macos )
- [Windows ](#windows )
- [Multiple runtime directories ](#multiple-runtime-directories )
2023-03-06 13:27:17 +04:00
- [Validating the installation ](#validating-the-installation )
- [Configure the desktop shortcut ](#configure-the-desktop-shortcut )
<!-- toc:end -->
To install Helix, follow the instructions specific to your operating system.
Note that:
- To get the latest nightly version of Helix, you need to
[build from source ](#building-from-source ).
- To take full advantage of Helix, install the language servers for your
preferred programming languages. See the
[wiki ](https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers )
for instructions.
## Pre-built binaries
Download pre-built binaries from the
[GitHub Releases page ](https://github.com/helix-editor/helix/releases ). Add the binary to your system's `$PATH` to use it from the command
line.
## Linux, macOS, Windows and OpenBSD packaging status
2021-06-22 20:05:08 +04:00
[![Packaging status ](https://repology.org/badge/vertical-allrepos/helix.svg )](https://repology.org/project/helix/versions)
2023-03-06 13:27:17 +04:00
## Linux
2021-04-05 10:18:43 +04:00
2023-03-06 13:27:17 +04:00
The following third party repositories are available:
2021-04-05 10:18:43 +04:00
2023-03-06 13:27:17 +04:00
### Ubuntu
2021-04-05 10:18:43 +04:00
2023-04-20 02:56:18 +04:00
Add the `PPA` for Helix:
2021-04-05 10:18:43 +04:00
2023-03-06 13:27:17 +04:00
```sh
sudo add-apt-repository ppa:maveonair/helix-editor
sudo apt update
sudo apt install helix
```
2021-04-05 10:18:43 +04:00
2023-03-06 13:27:17 +04:00
### Fedora/RHEL
2022-03-02 06:12:50 +04:00
2023-04-20 02:56:18 +04:00
Enable the `COPR` repository for Helix:
2022-07-09 20:09:37 +04:00
2023-03-06 13:27:17 +04:00
```sh
sudo dnf copr enable varlad/helix
sudo dnf install helix
```
2021-04-05 10:18:43 +04:00
2023-03-06 13:27:17 +04:00
### Arch Linux community
2021-04-05 10:18:43 +04:00
2023-03-06 13:27:17 +04:00
Releases are available in the `community` repository:
2021-09-07 08:00:52 +04:00
2023-03-06 13:27:17 +04:00
```sh
sudo pacman -S helix
```
Additionally, a [helix-git ](https://aur.archlinux.org/packages/helix-git/ ) package is available
in the AUR, which builds the master branch.
2021-04-05 10:18:43 +04:00
2023-03-06 13:27:17 +04:00
### NixOS
2021-12-17 18:46:32 +04:00
2023-05-26 13:33:20 +04:00
Helix is available in [nixpkgs ](https://github.com/nixos/nixpkgs ) through the `helix` attribute,
the unstable channel usually carries the latest release.
Helix is also available as a [flake ](https://nixos.wiki/wiki/Flakes ) in the project
2023-03-06 13:27:17 +04:00
root. Use `nix develop` to spin up a reproducible development shell. Outputs are
cached for each push to master using [Cachix ](https://www.cachix.org/ ). The
flake is configured to automatically make use of this cache assuming the user
accepts the new settings on first use.
2021-12-17 18:46:32 +04:00
2023-03-06 13:27:17 +04:00
If you are using a version of Nix without flakes enabled,
[install Cachix CLI ](https://docs.cachix.org/installation ) and use
`cachix use helix` to configure Nix to use cached outputs when possible.
2023-03-21 03:36:27 +04:00
2023-05-09 17:38:36 +04:00
### Flatpak
Helix is available on [Flathub ](https://flathub.org/en-GB/apps/com.helix_editor.Helix ):
```sh
flatpak install flathub com.helix_editor.Helix
flatpak run com.helix_editor.Helix
```
2023-03-21 03:36:27 +04:00
### AppImage
2023-04-20 02:56:18 +04:00
Install Helix using the Linux [AppImage ](https://appimage.org/ ) format.
Download the official Helix AppImage from the [latest releases ](https://github.com/helix-editor/helix/releases/latest ) page.
2023-03-21 03:36:27 +04:00
```sh
chmod +x helix-*.AppImage # change permission for executable mode
./helix-*.AppImage # run helix
```
2023-03-06 13:27:17 +04:00
## macOS
2021-12-17 18:46:32 +04:00
2023-03-06 13:27:17 +04:00
### Homebrew Core
2022-03-31 23:55:55 +04:00
2023-03-06 13:27:17 +04:00
```sh
brew install helix
2022-03-31 23:55:55 +04:00
```
2022-10-20 02:19:03 +04:00
## Windows
2023-04-09 23:57:41 +04:00
Install on Windows using [Winget ](https://learn.microsoft.com/en-us/windows/package-manager/winget/ ), [Scoop ](https://scoop.sh/ ), [Chocolatey ](https://chocolatey.org/ )
2022-10-30 20:55:31 +04:00
or [MSYS2 ](https://msys2.org/ ).
2022-10-20 02:19:03 +04:00
2023-04-09 23:57:41 +04:00
### Winget
Windows Package Manager winget command-line tool is by default available on Windows 11 and modern versions of Windows 10 as a part of the App Installer.
You can get [App Installer from the Microsoft Store ](https://www.microsoft.com/p/app-installer/9nblggh4nns1#activetab=pivot:overviewtab ). If it's already installed, make sure it is updated with the latest version.
```sh
winget install Helix.Helix
```
2023-03-06 13:27:17 +04:00
### Scoop
2022-10-20 02:19:03 +04:00
2023-03-06 13:27:17 +04:00
```sh
2022-10-20 02:19:03 +04:00
scoop install helix
```
2023-03-06 13:27:17 +04:00
### Chocolatey
2022-10-20 02:19:03 +04:00
2023-03-06 13:27:17 +04:00
```sh
2022-10-20 02:19:03 +04:00
choco install helix
```
2023-03-06 13:27:17 +04:00
### MSYS2
2022-10-30 20:55:31 +04:00
2023-03-06 13:27:17 +04:00
For 64-bit Windows 8.1 or above:
2022-10-30 20:55:31 +04:00
2023-03-06 13:27:17 +04:00
```sh
2022-10-30 20:55:31 +04:00
pacman -S mingw-w64-ucrt-x86_64-helix
```
2022-10-20 02:19:03 +04:00
2023-03-06 13:27:17 +04:00
## Building from source
2021-04-05 10:18:43 +04:00
2023-04-20 02:56:18 +04:00
Requirements:
2023-06-13 05:35:12 +04:00
Clone the Helix GitHub repository into a directory of your choice. The
examples in this documentation assume installation into either `~/src/` on
Linux and macOS, or `%userprofile%\src\` on Windows.
2023-04-20 02:56:18 +04:00
- The [Rust toolchain ](https://www.rust-lang.org/tools/install )
- The [Git version control system ](https://git-scm.com/ )
2023-06-08 08:27:58 +04:00
- A C++14 compatible compiler to build the tree-sitter grammars, for example GCC or Clang
2023-04-20 02:56:18 +04:00
If you are using the `musl-libc` standard library instead of `glibc` the following environment variable must be set during the build to ensure tree-sitter grammars can be loaded correctly:
```sh
RUSTFLAGS="-C target-feature=-crt-static"
```
1. Clone the repository:
2023-03-06 13:27:17 +04:00
```sh
2022-02-15 03:23:35 +04:00
git clone https://github.com/helix-editor/helix
2021-05-12 15:32:44 +04:00
cd helix
2021-04-05 10:18:43 +04:00
```
2023-04-20 02:56:18 +04:00
2. Compile from source:
2023-01-18 20:01:17 +04:00
2023-03-06 13:27:17 +04:00
```sh
cargo install --path helix-term --locked
2023-01-18 20:01:17 +04:00
```
2023-03-06 13:27:17 +04:00
This command will create the `hx` executable and construct the tree-sitter
2023-04-20 02:56:18 +04:00
grammars in the local `runtime` folder.
2022-10-20 02:19:03 +04:00
2023-03-06 13:27:17 +04:00
> 💡 Tree-sitter grammars can be fetched and compiled if not pre-packaged. Fetch
2023-04-20 02:56:18 +04:00
> grammars with `hx --grammar fetch` and compile them with
> `hx --grammar build`. This will install them in
2023-03-09 18:50:43 +04:00
> the `runtime` directory within the user's helix config directory (more
> [details below](#multiple-runtime-directories)).
2022-10-20 02:19:03 +04:00
2023-03-06 13:27:17 +04:00
### Configuring Helix's runtime files
2022-10-20 02:19:03 +04:00
2023-03-09 18:50:43 +04:00
#### Linux and macOS
2022-10-20 02:19:03 +04:00
2023-06-13 05:35:12 +04:00
The **runtime** directory is one below the Helix source, so either set a
`HELIX_RUNTIME` environment variable to point to that directory and add it to
your `~/.bashrc` or equivalent:
2022-10-20 02:19:03 +04:00
2023-03-06 13:27:17 +04:00
```sh
2023-06-13 05:35:12 +04:00
HELIX_RUNTIME=~/src/helix/runtime
2022-10-20 02:19:03 +04:00
```
2022-04-20 05:44:11 +04:00
2023-06-13 05:35:12 +04:00
Or, create a symbolic link:
2022-10-21 04:39:30 +04:00
2023-03-06 13:27:17 +04:00
```sh
2023-06-05 04:06:25 +04:00
ln -Ts $PWD/runtime ~/.config/helix/runtime
2023-03-06 13:27:17 +04:00
```
2022-10-21 04:39:30 +04:00
2023-06-05 04:06:25 +04:00
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.
2023-03-09 18:50:43 +04:00
#### Windows
2022-10-21 04:39:30 +04:00
2023-03-06 13:27:17 +04:00
Either set the `HELIX_RUNTIME` environment variable to point to the runtime files using the Windows setting (search for
`Edit environment variables for your account` ) or use the `setx` command in
Cmd:
2022-10-10 21:23:36 +04:00
2023-03-06 13:27:17 +04:00
```sh
setx HELIX_RUNTIME "%userprofile%\source\repos\helix\runtime"
2022-10-10 21:23:36 +04:00
```
2023-03-06 13:27:17 +04:00
> 💡 `%userprofile%` resolves to your user directory like
> `C:\Users\Your-Name\` for example.
2022-10-10 21:23:36 +04:00
2023-03-06 13:27:17 +04:00
Or, create a symlink in `%appdata%\helix\` that links to the source code directory:
2022-10-10 21:23:36 +04:00
2023-03-09 18:50:43 +04:00
| Method | Command |
| ---------- | -------------------------------------------------------------------------------------- |
| PowerShell | `New-Item -ItemType Junction -Target "runtime" -Path "$Env:AppData\helix\runtime"` |
| Cmd | `cd %appdata%\helix` < br /> `mklink /D runtime "%userprofile%\src\helix\runtime"` |
2022-10-10 21:23:36 +04:00
2023-03-09 18:50:43 +04:00
> 💡 On Windows, creating a symbolic link may require running PowerShell or
> Cmd as an administrator.
#### 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` .
4. `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.
2022-10-10 21:23:36 +04:00
2023-03-06 13:27:17 +04:00
### Validating the installation
2022-05-03 01:46:25 +04:00
2023-03-06 13:27:17 +04:00
To make sure everything is set up as expected you should run the Helix health
check:
```sh
2022-05-03 01:46:25 +04:00
hx --health
```
2023-03-06 13:27:17 +04:00
For more information on the health check results refer to
[Health check ](https://github.com/helix-editor/helix/wiki/Healthcheck ).
2022-05-03 01:46:25 +04:00
2023-03-06 13:27:17 +04:00
### Configure the desktop shortcut
2022-02-15 03:23:35 +04:00
2023-03-06 13:27:17 +04:00
If your desktop environment supports the
[XDG desktop menu ](https://specifications.freedesktop.org/menu-spec/menu-spec-latest.html )
you can configure Helix to show up in the application menu by copying the
provided `.desktop` and icon files to their correct folders:
2022-07-09 20:08:47 +04:00
2023-03-06 13:27:17 +04:00
```sh
cp contrib/Helix.desktop ~/.local/share/applications
cp contrib/helix.png ~/.icons # or ~/.local/share/icons
```
To use another terminal than the system default, you can modify the `.desktop`
file. For example, to use `kitty` :
2022-07-09 20:08:47 +04:00
2023-03-06 13:27:17 +04:00
```sh
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
```