fix(nvim): treesitter plugins not found

nixos
Moritz Böhme 2023-06-23 08:32:40 +02:00
parent 29cfce1111
commit b5380bb2bb
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
1 changed files with 16 additions and 3 deletions

View File

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ lib, pkgs, ... }:
with builtins;
{
@ -115,9 +115,22 @@ with builtins;
lazy = false;
}
{
plugin = nvim-treesitter.withAllGrammars;
plugin = nvim-treesitter;
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 = [
{ plugin = nvim-ts-context-commentstring; }
{