This repository has been archived on 2024-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
neovim/plugins/syntax/default.nix

37 lines
701 B
Nix
Raw Normal View History

2022-10-22 23:35:27 +03:00
{ lib
, nvim-treesitter
, tree-sitter
, grammarFileTypes
, ...
}:
2022-09-15 09:57:11 +03:00
2022-09-24 17:21:16 +03:00
let
2022-10-22 23:35:27 +03:00
inherit (builtins) readFile;
extraGrammars = {
tree-sitter-org = lib.importJSON ./tree-sitter-org-nvim.json // { language = "org"; };
};
extended-treesitter = tree-sitter.override { inherit extraGrammars; };
treeSitterGrammars = extended-treesitter.withPlugins (
grammars: map (ft: grammars."tree-sitter-${ft}") grammarFileTypes
);
2022-09-24 17:21:16 +03:00
nvim-treesitter-with-grammars = nvim-treesitter.overrideAttrs (oldAttrs: {
postPatch = ''
rm -r parser
2022-10-22 23:35:27 +03:00
ln -s ${treeSitterGrammars} parser
2022-09-24 17:21:16 +03:00
'';
});
in
2022-09-15 09:57:11 +03:00
{
2022-10-22 23:35:27 +03:00
luaConfig = readFile ./treesitter.lua;
2022-09-15 09:57:11 +03:00
plugins = [
2022-09-24 17:21:16 +03:00
nvim-treesitter-with-grammars
2022-09-15 09:57:11 +03:00
];
}