2021-04-05 10:18:43 +04:00
# Installation
2021-05-12 15:32:44 +04:00
We provide pre-built binaries on the [GitHub Releases page ](https://github.com/helix-editor/helix/releases ).
2021-04-05 10:18:43 +04:00
2021-06-22 20:05:08 +04:00
[![Packaging status ](https://repology.org/badge/vertical-allrepos/helix.svg )](https://repology.org/project/helix/versions)
2021-04-05 10:18:43 +04:00
## OSX
2022-08-31 12:45:38 +04:00
Helix is available in homebrew-core:
2021-04-05 10:18:43 +04:00
2021-06-17 18:21:33 +04:00
```
brew install helix
```
2021-04-05 10:18:43 +04:00
## Linux
### NixOS
A [flake ](https://nixos.wiki/wiki/Flakes ) containing the package is available in
the project root. The flake can also be used to spin up a reproducible development
2022-03-02 06:12:50 +04:00
shell for working on Helix with `nix develop` .
Flake outputs are cached for each push to master using
2022-07-09 20:09:37 +04:00
[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.
If you are using a version of Nix without flakes enabled you can
[install Cachix cli ](https://docs.cachix.org/installation ); `cachix use helix` will
2022-03-02 06:12:50 +04:00
configure Nix to use cached outputs when possible.
2021-04-05 10:18:43 +04:00
### Arch Linux
2021-09-07 08:00:52 +04:00
Releases are available in the `community` repository.
2021-11-29 16:07:32 +04:00
A [helix-git ](https://aur.archlinux.org/packages/helix-git/ ) package is also available on the AUR, which builds the master branch.
2021-04-05 10:18:43 +04:00
2021-12-17 18:46:32 +04:00
### Fedora Linux
You can install the COPR package for Helix via
```
sudo dnf copr enable varlad/helix
sudo dnf install helix
```
2022-03-31 23:55:55 +04:00
### Void Linux
```
sudo xbps-install helix
```
2022-10-20 02:19:03 +04:00
## Windows
2022-10-30 20:55:31 +04:00
Helix can be installed using [Scoop ](https://scoop.sh/ ), [Chocolatey ](https://chocolatey.org/ )
or [MSYS2 ](https://msys2.org/ ).
2022-10-20 02:19:03 +04:00
**Scoop:**
```
scoop install helix
```
**Chocolatey:**
```
choco install helix
```
2022-10-30 20:55:31 +04:00
**MSYS2:**
2023-01-20 20:05:34 +04:00
Choose the [proper command ](https://www.msys2.org/docs/package-naming/ ) for your system from below:
2023-01-07 09:46:45 +04:00
- For 32 bit Windows 7 or above:
2022-10-30 20:55:31 +04:00
```
pacman -S mingw-w64-i686-helix
```
2023-01-07 09:46:45 +04:00
- For 64 bit Windows 7 or above:
2022-10-30 20:55:31 +04:00
```
pacman -S mingw-w64-x86_64-helix
```
2023-01-07 09:46:45 +04:00
- For 64 bit Windows 8.1 or above:
2022-10-30 20:55:31 +04:00
```
pacman -S mingw-w64-ucrt-x86_64-helix
```
2022-10-20 02:19:03 +04:00
2021-04-05 10:18:43 +04:00
## Build from source
```
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
2023-01-08 07:55:35 +04:00
cargo install --path helix-term --locked
2021-04-05 10:18:43 +04:00
```
2022-10-21 04:39:30 +04:00
This will install the `hx` binary to `$HOME/.cargo/bin` and build tree-sitter grammars in `./runtime/grammars` .
2021-05-12 15:32:44 +04:00
2023-01-18 20:01:17 +04:00
If you are using the musl-libc instead of glibc the following environment variable must be set during the build
to ensure tree sitter grammars can be loaded correctly:
```
RUSTFLAGS="-C target-feature=-crt-static"
```
2022-10-10 21:23:36 +04:00
Helix also needs its runtime files so make sure to copy/symlink the `runtime/` directory into the
2022-04-27 23:21:20 +04:00
config directory (for example `~/.config/helix/runtime` on Linux/macOS). This location can be overridden
2021-07-30 11:27:22 +04:00
via the `HELIX_RUNTIME` environment variable.
2022-02-15 03:23:35 +04:00
2022-10-20 02:19:03 +04:00
| OS | Command |
| -------------------- | ------------------------------------------------ |
| Windows (Cmd) | `xcopy /e /i runtime %AppData%\helix\runtime` |
| Windows (PowerShell) | `xcopy /e /i runtime $Env:AppData\helix\runtime` |
2022-11-08 21:02:49 +04:00
| Linux / macOS | `ln -s $PWD/runtime ~/.config/helix/runtime` |
2022-10-20 02:19:03 +04:00
Starting with Windows Vista you can also create symbolic links on Windows. Note that this requires
2022-11-08 18:29:48 +04:00
elevated privileges - i.e. PowerShell or Cmd must be run as administrator.
2022-10-20 02:19:03 +04:00
**PowerShell:**
```powershell
2023-02-05 23:31:20 +04:00
New-Item -ItemType Junction -Target "runtime" -Path "$Env:AppData\helix\runtime"
2022-10-20 02:19:03 +04:00
```
2023-02-05 23:31:20 +04:00
Note: "runtime" must be the absolute path to the runtime directory.
2022-10-20 02:19:03 +04:00
**Cmd:**
```cmd
cd %appdata%\helix
mklink /D runtime "< helix-repo > \runtime"
```
2022-04-20 05:44:11 +04:00
2022-10-21 04:39:30 +04:00
The runtime location can be overridden via the `HELIX_RUNTIME` environment variable.
2023-01-08 07:55:35 +04:00
> NOTE: if `HELIX_RUNTIME` is set prior to calling `cargo install --path helix-term --locked`,
2022-10-21 04:39:30 +04:00
> tree-sitter grammars will be built in `$HELIX_RUNTIME/grammars`.
If you plan on keeping the repo locally, an alternative to copying/symlinking
runtime files is to set `HELIX_RUNTIME=/path/to/helix/runtime`
(`HELIX_RUNTIME=$PWD/runtime` if you're in the helix repo directory).
2022-10-10 21:23:36 +04:00
To use Helix in desktop environments that supports [XDG desktop menu ](https://specifications.freedesktop.org/menu-spec/menu-spec-latest.html ), including Gnome and KDE, copy the provided `.desktop` file to the correct folder:
```bash
cp contrib/Helix.desktop ~/.local/share/applications
```
To use another terminal than the default, you will need to modify the `.desktop` file. For example, to use `kitty` :
```bash
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
```
Please note: there is no icon for Helix yet, so the system default will be used.
## Finishing up the installation
To make sure everything is set up as expected you should finally run the helix healthcheck via
2022-05-03 01:46:25 +04:00
```
hx --health
```
2022-10-10 21:23:36 +04:00
For more information on the information displayed in the health check results refer to [Healthcheck ](https://github.com/helix-editor/helix/wiki/Healthcheck ).
2022-05-03 01:46:25 +04:00
2022-07-09 20:08:47 +04:00
### Building tree-sitter grammars
2022-02-15 03:23:35 +04:00
Tree-sitter grammars must be fetched and compiled if not pre-packaged.
2022-03-08 10:13:15 +04:00
Fetch grammars with `hx --grammar fetch` (requires `git` ) and compile them
2022-05-28 20:02:47 +04:00
with `hx --grammar build` (requires a C++ compiler).
2022-07-09 20:08:47 +04:00
### Installing language servers
Language servers can optionally be installed if you want their features (auto-complete, diagnostics etc.).
Follow the [instructions on the wiki page ](https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers ) to add your language servers of choice.