<commit_before>{ lib, pkgs, config, ... }:
with lib;
let cfg = config.foundry.terminal.editors.neovim;
  inherit (pkgs) stdenv;
  inherit (lib) optionals;
in
{
  options.foundry.terminal.editors.neovim = {
    enable = mkEnableOption "todo";
  };

  config = mkIf cfg.enable {
    home.packages = with pkgs; [
      tree-sitter

      yaml-language-server
    ];
    programs.neovim = {
      enable = true;
      withNodeJs = true; # enable node provider # todo: need this?
      withPython3 = true; # todo: need this?
      plugins = with pkgs.vimPlugins; [
        {
          # Installing tree-sitter via neovims built in tooling is not a great
          # idea within nix, and not very reproducible. Luckily, we can install
          # all the grammars like everything else.
          #
          # https://github.com/nvim-treesitter/nvim-treesitter
          # https://nixos.org/manual/nixpkgs/unstable/#managing-plugins-with-vim-packages
          plugin = nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars);
          config = ''
            lua <<CFG
              require'nvim-treesitter.configs'.setup {
                highlight = {
                  enable = true,<commit_msg>feat(nvim): add gopls language server<commit_after>{ lib, pkgs, config, ... }:
with lib;
let cfg = config.foundry.terminal.editors.neovim;
  inherit (pkgs) stdenv;
  inherit (lib) optionals;
in
{
  options.foundry.terminal.editors.neovim = {
    enable = mkEnableOption "todo";
  };

  config = mkIf cfg.enable {
    home.packages = with pkgs; [
      tree-sitter

      # language servers
      gopls
      yaml-language-server
    ];
    programs.neovim = {
      enable = true;
      withNodeJs = true; # enable node provider # todo: need this?
      withPython3 = true; # todo: need this?
      plugins = with pkgs.vimPlugins; [
        {
          # Installing tree-sitter via neovims built in tooling is not a great
          # idea within nix, and not very reproducible. Luckily, we can install
          # all the grammars like everything else.
          #
          # https://github.com/nvim-treesitter/nvim-treesitter
          # https://nixos.org/manual/nixpkgs/unstable/#managing-plugins-with-vim-packages
          plugin = nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars);
          config = ''
            lua <<CFG
              require'nvim-treesitter.configs'.setup {
                highlight = {
                  enable = true,
{'fraction_non_alphanumeric': 0.10513546300040437, 'fraction_numerical': 0.0008087343307723412, 'mean_word_length': 2.1435832274459976, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2746048', 'n_tokens_mistral': 801, 'n_tokens_neox': 748, 'n_words': 182}