fix(nvim): treesitter plugins not found

This commit is contained in:
Moritz Böhme 2023-06-23 08:32:40 +02:00
parent 29cfce1111
commit b5380bb2bb
Signed by: moritz
GPG key ID: 970C6E89EB0547A9

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { lib, pkgs, ... }:
with builtins; with builtins;
{ {
@ -115,9 +115,22 @@ with builtins;
lazy = false; lazy = false;
} }
{ {
plugin = nvim-treesitter.withAllGrammars; plugin = nvim-treesitter;
event = [ "BufReadPost" "BufNewFile" ]; event = [ "BufReadPost" "BufNewFile" ];
conf = readFile ./nvim-treesitter.lua; conf =
let
parserDir = pkgs.symlinkJoin {
name = "tresitter-grammars-all";
paths = lib.attrValues (lib.filterAttrs (_: builtins.isAttrs) nvim-treesitter-parsers);
};
in
readFile ./nvim-treesitter.lua + ''
vim.opt.runtimepath:append("${parserDir}")
require'nvim-treesitter.configs'.setup {
parser_install_dir = "${parserDir}",
}
'';
dependencies = [ dependencies = [
{ plugin = nvim-ts-context-commentstring; } { plugin = nvim-ts-context-commentstring; }
{ {