mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-07 19:35:01 +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 = {
|
plugins.treesitter = {
|
||||||
enable = mkEnableOption "Enable tree-sitter syntax highlighting";
|
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 {
|
nixGrammars = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
|
@ -126,8 +132,8 @@ in
|
||||||
'';
|
'';
|
||||||
|
|
||||||
extraPlugins = with pkgs; if cfg.nixGrammars then
|
extraPlugins = with pkgs; if cfg.nixGrammars then
|
||||||
[ (vimPlugins.nvim-treesitter.withPlugins (_: cfg.grammarPackages)) ]
|
[ (cfg.package.withPlugins (_: cfg.grammarPackages)) ]
|
||||||
else [ vimPlugins.nvim-treesitter ];
|
else [ cfg.package ];
|
||||||
extraPackages = [ pkgs.tree-sitter pkgs.nodejs ];
|
extraPackages = [ pkgs.tree-sitter pkgs.nodejs ];
|
||||||
|
|
||||||
options = mkIf cfg.folding {
|
options = mkIf cfg.folding {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue