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

20 lines
422 B
Nix
Raw Normal View History

{ 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)) ];
};
}