nixos-config/config/programs/vim/modules/languages/treesitter.nix

20 lines
420 B
Nix

{
pkgs,
lib,
config,
...
}:
with lib; let
cfg = config.treesitter;
grammars = pkgs.tree-sitter.builtGrammars;
in {
options.treesitter.enable = mkEnableOption "tree-sitter";
config = mkIf cfg.enable {
plugin.setup."nvim-treesitter.configs" = {
highlight.enable = true;
};
output.plugins = with pkgs.vimPlugins; [(nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars))];
};
}