{pkgs, ...}: {
  programs.helix = {
    enable = true;
    defaultEditor = true;

    settings = {
      theme = "gruvbox-material";

      editor = {
        # options
        indent-guides.render = true;
        cursorline = true;
        color-modes = true;

        lsp = {
          display-inlay-hints = true;
          display-messages = true;
        };

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

        clipboard-provider = "wayland";

        statusline = {
          left = ["mode" "spinner" "file-name" "file-modification-indicator"];
          right = ["diagnostics" "selections" "position" "file-encoding" "file-type"];
          center = ["workspace-diagnostics"];
        };

        auto-pairs = true;

        file-picker.hidden = false;
      };
    };

    languages = {
      language-server = {
        nil = {
          command = "nil";
          config.nil.formatting.command = ["nixfmt"];
        };
        marksman = {command = "marksman";};
        taplo = {
          command = "taplo";
          args = ["lsp" "stdio"];
        };
        bash-ls = {
          command = "bash-language-server";
          args = ["start"];
        };
        tinymist = {command = "tinymist";}; # typst
        vscode-css = {
          command = "vscode-css-language-server";
          args = ["--stdio"];
        };
        vscode-html = {
          command = "vscode-html-language-server";
          args = ["--stdio"];
        };
        emmet-ls = {
          command = "emmet-ls";
          args = ["--stdio"];
        };
        pyright = {
          command = "pyright-langserver";
          args = ["--stdio"];
        };
        ts-ls = {
          command = "typescript-language-server";
          args = ["--stdio"];
        };
        zls = {command = "zls";};
        omnisharp = {
          command = "OmniSharp";
          args = ["--languageserver"];
        };
        clangd = {command = "clangd";};
        rust-analyzer = {
          command = "rust-analyzer";
          config.rust-analyzer = {
            check.command = "clippy";
            cargo.allFeatures = true;
          };
        };
        nu = {
          command = "nu";
          args = ["--lsp"];
        };
      };

      language = [
        {
          name = "nix";
          auto-format = true;
          language-servers = ["nil"];
          formatter.command = "nixfmt";
        }
        {
          name = "markdown";
          auto-format = true;
          language-servers = ["marksman"];
        }
        {
          name = "toml";
          auto-format = true;
          language-servers = ["taplo"];
        }
        {
          name = "nu";
          language-servers = ["nu"];
        }
        {
          name = "bash";
          auto-format = true;
          language-servers = ["bash-ls"];
        }
        {
          name = "typst";
          auto-format = true;
          language-servers = ["tinymist"];
        }
        {
          name = "css";
          auto-format = true;
          language-servers = ["vscode-css"];
        }
        {
          name = "html";
          auto-format = true;
          language-servers = ["vscode-html" "emmet-ls"];
        }
        {
          name = "python";
          auto-format = true;
          language-servers = ["pyright"];
        }
        {
          name = "typescript";
          auto-format = true;
          language-servers = ["ts-ls"];
        }
        {
          name = "tsx";
          auto-format = true;
          language-servers = ["ts-ls"];
        }
        {
          name = "zig";
          auto-format = true;
          language-servers = ["zls"];
        }
        {
          name = "c-sharp";
          auto-format = true;
          language-servers = ["omnisharp"];
          debugger = {
            name = "netcoredbg";
            transport = "tcp";
            command = "netcoredbg";
            port-arg = "--server={port}";
            templates = [
              {
                name = "launch";
                request = "launch";
                completion = [
                  {
                    name = "DLL path";
                    completion = "filename";
                    default = "bin/Debug/net8.0/App.dll";
                  }
                ];
                args = {
                  type = "coreclr";
                  request = "launch";
                  program = "{0}";
                };
              }
              {
                name = "attach";
                request = "attach";
                completion = [
                  {
                    name = "PID";
                    completion = "pid";
                  }
                ];
                args = {
                  type = "coreclr";
                  request = "attach";
                  processId = "{0}";
                };
              }
            ];
          };
        }
        {
          name = "c";
          auto-format = true;
          language-servers = ["clangd"];
        }
        {
          name = "cpp";
          auto-format = true;
          language-servers = ["clangd"];
        }
        {
          name = "rust";
          auto-format = true;
          language-servers = ["rust-analyzer"];
        }
      ];
    };
  };
}
