on 376c19e help sign in
helix/book/src/install.md
180 lines 5.5 kB history raw
1# Installation
3We provide pre-built binaries on the [GitHub Releases page](https://github.com/helix-editor/helix/releases).
5[![Packaging status](https://repology.org/badge/vertical-allrepos/helix.svg)](https://repology.org/project/helix/versions)
7## OSX
9Helix is available in homebrew-core:
11```
12brew install helix
13```
15## Linux
17### NixOS
19A [flake](https://nixos.wiki/wiki/Flakes) containing the package is available in
20the project root. The flake can also be used to spin up a reproducible development
21shell for working on Helix with `nix develop`.
23Flake outputs are cached for each push to master using
24[Cachix](https://www.cachix.org/). The flake is configured to
25automatically make use of this cache assuming the user accepts
26the new settings on first use.
28If you are using a version of Nix without flakes enabled you can
29[install Cachix cli](https://docs.cachix.org/installation); `cachix use helix` will
30configure Nix to use cached outputs when possible.
32### Arch Linux
34Releases are available in the `community` repository.
36A [helix-git](https://aur.archlinux.org/packages/helix-git/) package is also available on the AUR, which builds the master branch.
38### Fedora Linux
40You can install the COPR package for Helix via
42```
43sudo dnf copr enable varlad/helix
44sudo dnf install helix
45```
47### Void Linux
49```
50sudo xbps-install helix
51```
53## Windows
55Helix can be installed using [Scoop](https://scoop.sh/), [Chocolatey](https://chocolatey.org/)
56or [MSYS2](https://msys2.org/).
58**Scoop:**
60```
61scoop install helix
62```
64**Chocolatey:**
66```
67choco install helix
68```
70**MSYS2:**
72Choose the [proper command](https://www.msys2.org/docs/package-naming/) for your system from below:
74 - For 32 bit Windows 7 or above:
76```
77pacman -S mingw-w64-i686-helix
78```
80 - For 64 bit Windows 7 or above:
82```
83pacman -S mingw-w64-x86_64-helix
84```
86 - For 64 bit Windows 8.1 or above:
88```
89pacman -S mingw-w64-ucrt-x86_64-helix
90```
92## Build from source
94```
95git clone https://github.com/helix-editor/helix
96cd helix
97cargo install --path helix-term --locked
98```
100This will install the `hx` binary to `$HOME/.cargo/bin` and build tree-sitter grammars in `./runtime/grammars`.
102If you are using the musl-libc instead of glibc the following environment variable must be set during the build
103to ensure tree sitter grammars can be loaded correctly:
105```
106RUSTFLAGS="-C target-feature=-crt-static"
107```
110Helix also needs its runtime files so make sure to copy/symlink the `runtime/` directory into the
111config directory (for example `~/.config/helix/runtime` on Linux/macOS). This location can be overridden
112via the `HELIX_RUNTIME` environment variable.
114| OS | Command |
115| -------------------- | ------------------------------------------------ |
116| Windows (Cmd) | `xcopy /e /i runtime %AppData%\helix\runtime` |
117| Windows (PowerShell) | `xcopy /e /i runtime $Env:AppData\helix\runtime` |
118| Linux / macOS | `ln -s $PWD/runtime ~/.config/helix/runtime` |
120Starting with Windows Vista you can also create symbolic links on Windows. Note that this requires
121elevated privileges - i.e. PowerShell or Cmd must be run as administrator.
123**PowerShell:**
125```powershell
126New-Item -ItemType Junction -Target "runtime" -Path "$Env:AppData\helix\runtime"
127```
128Note: "runtime" must be the absolute path to the runtime directory.
130**Cmd:**
132```cmd
133cd %appdata%\helix
134mklink /D runtime "<helix-repo>\runtime"
135```
137The runtime location can be overridden via the `HELIX_RUNTIME` environment variable.
139> NOTE: if `HELIX_RUNTIME` is set prior to calling `cargo install --path helix-term --locked`,
140> tree-sitter grammars will be built in `$HELIX_RUNTIME/grammars`.
142If you plan on keeping the repo locally, an alternative to copying/symlinking
143runtime files is to set `HELIX_RUNTIME=/path/to/helix/runtime`
144(`HELIX_RUNTIME=$PWD/runtime` if you're in the helix repo directory).
146To 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:
148```bash
149cp contrib/Helix.desktop ~/.local/share/applications
150```
152To use another terminal than the default, you will need to modify the `.desktop` file. For example, to use `kitty`:
154```bash
155sed -i "s|Exec=hx %F|Exec=kitty hx %F|g" ~/.local/share/applications/Helix.desktop
156sed -i "s|Terminal=true|Terminal=false|g" ~/.local/share/applications/Helix.desktop
157```
159Please note: there is no icon for Helix yet, so the system default will be used.
161## Finishing up the installation
163To make sure everything is set up as expected you should finally run the helix healthcheck via
165```
166hx --health
167```
169For more information on the information displayed in the health check results refer to [Healthcheck](https://github.com/helix-editor/helix/wiki/Healthcheck).
171### Building tree-sitter grammars
173Tree-sitter grammars must be fetched and compiled if not pre-packaged.
174Fetch grammars with `hx --grammar fetch` (requires `git`) and compile them
175with `hx --grammar build` (requires a C++ compiler).
177### Installing language servers
179Language servers can optionally be installed if you want their features (auto-complete, diagnostics etc.).
180Follow 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.