feat: use mkGrammarOption

This commit is contained in:
NotAShelf 2023-04-18 00:55:27 +03:00
commit 544792e0b9
No known key found for this signature in database
GPG key ID: F0D14CCB5ED5AA22
13 changed files with 31 additions and 47 deletions

View file

@ -9,6 +9,11 @@ with builtins; let
cfg = config.vim.languages.markdown;
in {
config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable {
vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.package];
})
(mkIf cfg.glow.enable {
vim.startPlugins = ["glow-nvim"];

View file

@ -16,5 +16,14 @@ in {
default = true;
description = "Enable markdown preview in neovim with glow";
};
treesitter = {
enable = mkOption {
description = "Enable Markdown treesitter";
type = types.bool;
default = config.vim.languages.enableTreesitter;
};
package = nvim.types.mkGrammarOption pkgs "markdown";
};
};
}