mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-07 11:25:06 +02:00
treesitter: package option
This commit is contained in:
parent
7cd4a44462
commit
23604dd5b0
1 changed files with 8 additions and 2 deletions
|
@ -9,6 +9,12 @@ in
|
|||
plugins.treesitter = {
|
||||
enable = mkEnableOption "Enable tree-sitter syntax highlighting";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.vimPlugins.nvim-treesitter;
|
||||
description = "Plugin to use for nvim-treesitter. If using nixGrammars, it should include a `withPlugins` function";
|
||||
};
|
||||
|
||||
nixGrammars = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
@ -126,8 +132,8 @@ in
|
|||
'';
|
||||
|
||||
extraPlugins = with pkgs; if cfg.nixGrammars then
|
||||
[ (vimPlugins.nvim-treesitter.withPlugins (_: cfg.grammarPackages)) ]
|
||||
else [ vimPlugins.nvim-treesitter ];
|
||||
[ (cfg.package.withPlugins (_: cfg.grammarPackages)) ]
|
||||
else [ cfg.package ];
|
||||
extraPackages = [ pkgs.tree-sitter pkgs.nodejs ];
|
||||
|
||||
options = mkIf cfg.folding {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue