Helix: Difference between revisions

From NixOS Wiki
Klinger (talk | contribs)
Category and sentence to explain what it is. hx --health.
Hexa (talk | contribs)
Line 7: Line 7:
</syntaxhighlight>Depending on the programming languages it is helpful to install additional packages from nixpgks. To show what packages are needed, it is necessary to run Helix:
</syntaxhighlight>Depending on the programming languages it is helpful to install additional packages from nixpgks. To show what packages are needed, it is necessary to run Helix:


hx --health   
<code>hx --health</code>  


=== With Home Manager ===
=== With Home Manager ===

Revision as of 13:23, 20 June 2024

Helix is a modal text-editor inspired by Neovim and Kakoune, written in Rust. Compared to neovim, it is preconfigured with the functions that most people need. It has no plugin system. It uses (neo-)vim motions keybindings, but it uses the object-verb approach (visually highlighting text and then executing a function on it). It is intended for people who like to use a modal text editor but don't want to spend a lot of time configuring it.

Installation

Helix can be installed system-wide on NixOS with the helix package:

environment.systemPackages = [ pkgs.helix ];

Depending on the programming languages it is helpful to install additional packages from nixpgks. To show what packages are needed, it is necessary to run Helix:

hx --health

With Home Manager

Home Manager provides a module for configuring helix.

programs.helix = {
  enable = true;
  settings = {
    theme = "autumn_night_transparent";
    editor.cursor-shape = {
      normal = "block";
      insert = "bar";
      select = "underline";
    };
  };
  languages.language = [{
    name = "nix";
    auto-format = true;
    formatter.command = "${pkgs.nixfmt}/bin/nixfmt";
  }];
  themes = {
    autumn_night_transparent = {
      "inherits" = "autumn_night";
      "ui.background" = { };
    };
  };
};

Configuration

The configuration is stored in two files: ./.config/helix/config.toml and ./.config/helix/language.toml