mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-10 07:25:30 +00:00
Created mkEnableTreesitterOption in the extendend library
This commit is contained in:
parent
fe84f0e56f
commit
0b85f56868
3 changed files with 17 additions and 8 deletions
|
|
@ -10,6 +10,6 @@
|
||||||
in {
|
in {
|
||||||
inherit (typesDag) dagOf;
|
inherit (typesDag) dagOf;
|
||||||
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
|
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
|
||||||
inherit (typesLanguage) diagnostics mkGrammarOption;
|
inherit (typesLanguage) diagnostics mkGrammarOption mkEnableTreesitterOption;
|
||||||
inherit (customTypes) char hexColor mergelessListOf;
|
inherit (customTypes) char hexColor mergelessListOf;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{lib}: let
|
{lib}: let
|
||||||
inherit (lib.options) mkOption mkPackageOption;
|
inherit (lib.options) mkOption mkPackageOption;
|
||||||
inherit (lib.attrsets) attrNames;
|
inherit (lib.attrsets) attrNames;
|
||||||
inherit (lib.types) listOf either enum submodule package;
|
inherit (lib.types) listOf either enum submodule package bool;
|
||||||
|
|
||||||
diagnosticSubmodule = _: {
|
diagnosticSubmodule = _: {
|
||||||
options = {
|
options = {
|
||||||
|
|
@ -32,6 +32,13 @@
|
||||||
mkPackageOption pkgs ["${grammar} treesitter"] {
|
mkPackageOption pkgs ["${grammar} treesitter"] {
|
||||||
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar];
|
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mkEnableTreesitterOption = config: language:
|
||||||
|
mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = config.vim.languages.enableTreesitter;
|
||||||
|
description = "Whether to enable ${language} treesitter";
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
inherit diagnostics diagnosticSubmodule mkGrammarOption;
|
inherit diagnostics diagnosticSubmodule mkGrammarOption mkEnableTreesitterOption;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,21 +4,23 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.options) mkEnableOption;
|
# inherit (lib.options) mkEnableOption;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption mkEnableTreesitterOption;
|
||||||
|
|
||||||
cfg = config.vim.languages.tex;
|
cfg = config.vim.languages.tex;
|
||||||
|
|
||||||
mkEnableTreesitterOption = description: mkEnableOption description // {default = config.vim.languages.enableTreesitter;};
|
# mkEnableTreesitterOption = description: mkEnableOption description // {default = config.vim.languages.enableTreesitter;};
|
||||||
in {
|
in {
|
||||||
options.vim.languages.tex.treesitter = {
|
options.vim.languages.tex.treesitter = {
|
||||||
latex = {
|
latex = {
|
||||||
enable = mkEnableTreesitterOption "Whether to enable Latex treesitter";
|
# enable = mkEnableTreesitterOption "Whether to enable Latex treesitter";
|
||||||
|
enable = mkEnableTreesitterOption config "latex";
|
||||||
package = mkGrammarOption pkgs "latex";
|
package = mkGrammarOption pkgs "latex";
|
||||||
};
|
};
|
||||||
bibtex = {
|
bibtex = {
|
||||||
enable = mkEnableTreesitterOption "Whether to enable Bibtex treesitter";
|
# enable = mkEnableTreesitterOption "Whether to enable Bibtex treesitter";
|
||||||
|
enable = mkEnableTreesitterOption config "bibtex";
|
||||||
package = mkGrammarOption pkgs "bibtex";
|
package = mkGrammarOption pkgs "bibtex";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue