nix-dotfiles/hmModules/apps/neovim/plugin/treesitter.nix

38 lines
908 B
Nix
Raw Normal View History

{ config, pkgs, lib, ... }:
let
cfgp = config.neovim.plugins;
cfgl = config.neovim.languages;
in {
config = lib.mkIf (config.neovim.enable && cfgp.treesitter.enable) {
programs.neovim.plugins = let
configText = ''
require('nvim-treesitter.configs').setup {
ensure_installed = {},
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
}
'';
2024-04-17 20:59:21 -07:00
# I've tried many things, and can't get treesitter plugins changing
# dynamically. For not just have them always loaded regardless of config
treeplugs = p: [
p.tree-sitter-c
p.tree-sitter-go
2024-04-23 23:17:10 -07:00
p.tree-sitter-nix
p.tree-sitter-rust
2024-04-17 20:59:21 -07:00
];
in with pkgs.vimPlugins; [
{
plugin = (nvim-treesitter.withPlugins treeplugs);
type = "lua";
config = configText;
}
];
};
}