tree-sitter: Add withPlugins
This commit is contained in:
committed by
Matthieu Coudron
parent
a48ea1b0b3
commit
f29292db76
@@ -50,6 +50,9 @@
|
||||
, CoreFoundation
|
||||
, CoreServices
|
||||
|
||||
# nvim-treesitter dependencies
|
||||
, tree-sitter
|
||||
|
||||
# sved dependencies
|
||||
, glib
|
||||
, gobject-introspection
|
||||
@@ -364,6 +367,24 @@ self: super: {
|
||||
dependencies = with super; [ popfix ];
|
||||
});
|
||||
|
||||
# Usage:
|
||||
# pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [ p.tree-sitter-c p.tree-sitter-java ... ])
|
||||
# or for all grammars:
|
||||
# pkgs.vimPlugins.nvim-treesitter.withPlugins (_: tree-sitter.allGrammars)
|
||||
nvim-treesitter = super.nvim-treesitter.overrideAttrs (old: {
|
||||
passthru.withPlugins =
|
||||
grammarFn: self.nvim-treesitter.overrideAttrs (_: {
|
||||
postPatch =
|
||||
let
|
||||
grammars = tree-sitter.withPlugins grammarFn;
|
||||
in
|
||||
''
|
||||
rm -r parser
|
||||
ln -s ${grammars} parser
|
||||
'';
|
||||
});
|
||||
});
|
||||
|
||||
onehalf = super.onehalf.overrideAttrs (old: {
|
||||
configurePhase = "cd vim";
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user