{ ... }:

{
  programs.helix = {
    enable = true;
    defaultEditor = true;

    settings = {
      theme = "gruvbox_dark_hard";

      editor = {
        rulers = [ 80 ];
        true-color = true;

        cursor-shape = {
          insert = "bar";
          normal = "block";
          select = "underline";
        };
      };
    };

    languages = {
      language = [
        {
          name = "rpm-spec";
          scope = "source.bash";
          file-types = [ "spec" ];
          comment-token = "#";
          indent = { tab-width = 4; unit = "    "; };
          grammar = "bash";
          injection-regex = "%changelog";
          roots = [];
        }

        # {
        #   name = "bash";
        #   file-types = [
        #     "sh" "bash" "zsh"
        #     ".bash_login" ".bash_logout" ".bash_profile"
        #     ".bashrc" ".profile" ".zshenv" "zshenv" ".zlogin"
        #     "zlogin" ".zlogout" "zlogout" ".zprofile" "zprofile"
        #     ".zshrc" "zshrc" ".zimrc"
        #     "APKBUILD" "PKGBUILD" "eclass" "ebuild" "bazelrc"
        #     ".bash_aliases" "Renviron" ".Renviron"
        #     "spec"
        #   ];
        #   indent = { tab-width = 4; unit = "    "; };
        # }

        {
          name = "c";
          indent = { tab-width = 4; unit = "    "; };
        }

        {
          name = "latex";
          soft-wrap.enable = true;
          indent = { tab-width = 4; unit = "    "; };
        }

        {
          name = "lalrpop";
          scope = "source.rs";
          file-types = [ "lalrpop" ];
          comment-token = "//";
          indent = { tab-width = 4; unit = "    "; };
          grammar = "rust";
          roots = [];
        }
      ];
    };
  };
}
