dotfiles/modules/programs/nvim/plugins/treesitter.nix

43 lines
1.1 KiB
Nix
Raw Normal View History

2023-09-10 13:30:29 +02:00
{ lib, pkgs, ... }:
with builtins;
{
2023-09-17 09:35:10 +02:00
config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [
2023-09-10 13:30:29 +02:00
{
plugin = nvim-treesitter;
event = [ "BufReadPost" "BufNewFile" ];
conf =
let
parserDir = pkgs.symlinkJoin {
name = "tresitter-grammars-all";
paths = lib.attrValues (lib.filterAttrs (_: builtins.isAttrs) nvim-treesitter-parsers);
};
in
readFile ./lua/nvim-treesitter.lua + ''
vim.opt.runtimepath:append("${parserDir}")
require'nvim-treesitter.configs'.setup {
parser_install_dir = "${parserDir}",
}
'';
dependencies = [
2023-11-30 14:46:29 +01:00
{ plugin = nvim-ts-context-commentstring; opts = { }; }
2023-09-10 13:30:29 +02:00
];
}
{
plugin = nvim-treesitter-textsubjects;
event = [ "BufReadPost" "BufNewFile" ];
conf = readFile ./lua/nvim-treesitter-textsubjects.lua;
}
{
plugin = nvim-treesitter-context;
event = [ "BufReadPost" "BufNewFile" ];
opts = { };
}
{
plugin = hmts-nvim;
ft = [ "nix" ];
}
];
}